Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-18170

_id index should not be allowed to have partial filter or be sparse

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 3.1.1
    • Fix Version/s: 3.1.3
    • Component/s: Indexing
    • Labels:
    • Backwards Compatibility:
      Minor Change
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

          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);
      

      Show
      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

      Description

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

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: