Skip to content

Add unique index for Device model#1705

Merged
fgalan merged 3 commits intomasterfrom
task/add_device_index_unique_mongo
Apr 2, 2025
Merged

Add unique index for Device model#1705
fgalan merged 3 commits intomasterfrom
task/add_device_index_unique_mongo

Conversation

@AlvaroVega
Copy link
Copy Markdown
Member

@AlvaroVega AlvaroVega commented Mar 27, 2025

Unique index for Device model + handle duplicated mongo error when device is autoprovisioned.

Issue #1576

Related with https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/api.md#uniqueness-of-groups-and-devices

and fixes: telefonicaid/iotagent-json#865

@AlvaroVega AlvaroVega marked this pull request as ready for review March 27, 2025 10:21
@AlvaroVega AlvaroVega requested a review from fgalan March 31, 2025 08:45
Comment thread CHANGES_NEXT_RELEASE Outdated
Comment thread CHANGES_NEXT_RELEASE
@@ -1 +1,3 @@
- Fix: modified JEXL transformations (toisostring, gettime, parseint, etc.) to return null instead of NaN when some unexpected situation occurs (#1701) No newline at end of file
- Add: index for Device model based on {service: 1, subservice: 1, id: 1, apikey: 1} (#1576)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have index documented in some .md file (either in this repo or IOTA-JSON)? In that case, documentation should be changed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

@fgalan fgalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fgalan fgalan merged commit bfb348b into master Apr 2, 2025
6 checks passed
@fgalan fgalan deleted the task/add_device_index_unique_mongo branch October 10, 2025 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicated Devices when burst MQTT measures and non provisoned Device

2 participants