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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 3.1.3
    • 3.1.1
    • Index Maintenance
    • Minor Change
    • ALL
    • 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);
    • Quint Iteration 3

    Description

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

      Attachments

        Activity

          People

            rassi J Rassi
            michael.grundy Michael Grundy
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: