[SERVER-40880] _id index is not displayed as unique Created: 29/Apr/19  Updated: 29/Apr/19  Resolved: 29/Apr/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.0.9
Fix Version/s: None

Type: Question Priority: Minor - P4
Reporter: Björn Kautler Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-5335 Creation of _id index should automati... Backlog
Participants:

 Description   

The automatically generated index on _id is a uniqe index as far as I have read and tried.
But if you do db.collection.getIndexes() in the mongo shell, the index does not show "unique" : true, like other unique indexes do.
This seems a bit confusing to me.
Shouldn't the _id index be shown as unique, as it actually is a unique index?



 Comments   
Comment by Danny Hatcher (Inactive) [ 29/Apr/19 ]

Hello Bjorn,

You are correct; the auto-generated index on _id is a unique index. The fact that the index output does not mention that fact is being tracked in SERVER-5335 so I will close this ticket as a duplicate of that one. But please rest assured that this is solely an issue with the output of getIndexes and the index is actually unique.

Thanks,

Danny

Generated at Thu Feb 08 04:56:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.