[SERVER-26514] Create command should take idIndex option Created: 07/Oct/16 Updated: 17/May/19 Resolved: 24/Oct/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 3.4.0-rc2 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Tess Avitabile (Inactive) | Assignee: | Tess Avitabile (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Sprint: | Query 2016-10-31 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
The create command should take the full _id index spec as the idIndex option.
Required options are "key" and "name". "key" must be _id: 1 and "name" must be "_id_". No options are allowed other than "key", "name", "v", "ns", and "collation". If the "collation" differs from the collection default collation, we reject the command. If "collation" is not present, the _id index inherits the collection default collation. If "v" is not present, it is set to 2 if featureCompatibilityVersion=3.4 and 1 if featureCompatibilityVersion=3.2. |
| Comments |
| Comment by Githook User [ 24/Oct/16 ] | ||||||||||||||
|
Author: {u'username': u'tessavitabile', u'name': u'Tess Avitabile', u'email': u'tess.avitabile@mongodb.com'}Message: | ||||||||||||||
| Comment by Tess Avitabile (Inactive) [ 20/Oct/16 ] | ||||||||||||||
|
steve.briskin, we would like to require that the idIndex option does not contain any fields other than key, name, ns, v, and collation. These are the only fields in the spec for the _id index implicitly created by the create command. However, it is possible to create an _id index with other fields, by explicitly creating the _id index:
This means that if a user had generated an _id index this way and included extra fields, you would not be able to back up this collection. How does that sound to you? We hope that _id indexes generated this way are rare, and we do not want to make it easy for users to create _id indexes with extra fields. |