Details
-
Task
-
Resolution: Won't Fix
-
Major - P3
-
None
-
None
Description
We fixed SERVER-22041, which is a backwards breaking change. This should make it into the compatibility notes.
Previous behavior:
> db.foo.drop()
|
true
|
> db.foo.ensureIndex({a: 1}, {sparse: true}) |
{
|
"createdCollectionAutomatically" : true, |
"numIndexesBefore" : 1, |
"numIndexesAfter" : 2, |
"ok" : 1 |
}
|
> db.foo.insert({})
|
WriteResult({ "nInserted" : 1 }) |
> db.foo.find().hint({a: 1}).count()
|
1 // Unexpected: should return 0 instead. |
New behavior:
> db.foo.drop()
|
true
|
> db.foo.ensureIndex({a: 1}, {sparse: true}) |
{
|
"createdCollectionAutomatically" : true, |
"numIndexesBefore" : 1, |
"numIndexesAfter" : 2, |
"ok" : 1 |
}
|
> db.foo.insert({})
|
WriteResult({ "nInserted" : 1 }) |
> db.foo.find().hint({a: 1}).count()
|
0 // Weird, but this is consistent with how the find command respects hints. |