index_partial_exists.js uses invalid index option "$filter"

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.1.1
    • Component/s: Index Maintenance
    • ALL
    • Hide

      db.coll.ensureIndex(

      { b: 1, a: 1 }

      , {$$$filter: { b:

      { $exists: 1 }

      } });

      Show
      db.coll.ensureIndex( { b: 1, a: 1 } , {$$$filter: { b: { $exists: 1 } } });
    • Quint Iteration 3.1.2
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      In the partial index specification $filter is accepted as well as filter (like lines 105,140 & 141 in index_partial_exists.js does). $filter is also accepted with as many $$$ in front of filter as you can fit. The extra $ are stored in the index spec.

      
      > db.coll.ensureIndex({ b: 1, a: 1 }, {$$$filter: { b: { $exists: 1 } } })
      {
      	"raw" : {
      		"localhost:27018" : {
      			"createdCollectionAutomatically" : true,
      			"numIndexesBefore" : 1,
      			"numIndexesAfter" : 2,
      			"ok" : 1
      		}
      	},
      	"ok" : 1
      }
      
      > db.coll.getIndexSpecs()
      [
      	{
      		"v" : 1,
      		"key" : {
      			"_id" : 1
      		},
      		"name" : "_id_",
      		"ns" : "test.coll"
      	},
      	{
      		"v" : 1,
      		"key" : {
      			"b" : 1,
      			"a" : 1
      		},
      		"name" : "b_1_a_1",
      		"ns" : "test.coll",
      		"$$$filter" : {
      			"b" : {
      				"$exists" : 1
      			}
      		}
      	}
      ]
      

            Assignee:
            Michael Grundy (Inactive)
            Reporter:
            Michael Grundy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: