[SERVER-18170] _id index should not be allowed to have partial filter or be sparse Created: 22/Apr/15  Updated: 19/Sep/15  Resolved: 07/May/15

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: 3.1.1
Fix Version/s: 3.1.3

Type: Bug Priority: Minor - P4
Reporter: Michael Grundy Assignee: J Rassi
Resolution: Done Votes: 0
Labels: 32qa, FT
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Minor Change
Operating System: ALL
Steps To Reproduce:

    coll=db.id_partial;
    coll.drop();
    db.createCollection("id_partial", {autoIndexId: false});
    coll.ensureIndex({_id: 1}, {filter: {a: 1}});
    coll.insert({a:2});
    printjson(coll.getIndexSpecs());
    printjson(coll.validate.keysPerIndex);

Sprint: Quint Iteration 3
Participants:

 Description   

If you create a collection without the _id index, you can create a partial index on _id.



 Comments   
Comment by Githook User [ 07/May/15 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-18170 Forbid creation of _id index if it's also a sparse index
Branch: master
https://github.com/mongodb/mongo/commit/d396bd1802a6b797a3dcfeae48dceb764320739c

Comment by Githook User [ 07/May/15 ]

Author:

{u'username': u'jrassi', u'name': u'Jason Rassi', u'email': u'rassi@10gen.com'}

Message: SERVER-18170 Forbid creation of _id index if it's also a partial index
Branch: master
https://github.com/mongodb/mongo/commit/c5c476f6a5f3376fbf18b3f24fc450bd34aaff10

Generated at Thu Feb 08 03:46:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.