Details
-
Bug
-
Status: Closed
-
Trivial - P5
-
Resolution: Duplicate
-
2.2.2
-
None
-
osx 10.8, ubuntu 12.10, ubuntu 10.10
-
ALL
-
Description
it is allowed to create an
{a:0}index. This index has unexpected behavior with sorting
> db.some.insert(
{a:1})
> db.some.ensureIndex(
)
> db.some.find().sort(
)
{ "_id" : ObjectId("51254055e6f520cff750a549"), "a" : 1 }> db.some.find().sort(
{a:1}).explain()
{
"cursor" : "BtreeCursor a_0 reverse",
"isMultiKey" : false,
"n" : 1,
"nscannedObjects" : 1,
"nscanned" : 1,
"nscannedObjectsAllPlans" : 1,
"nscannedAllPlans" : 1,
"scanAndOrder" : false,
"indexOnly" : false,
"nYields" : 0,
"nChunkSkips" : 0,
"millis" : 0,
"indexBounds" : {
"a" : [
[
,
{ "$minElement" : 1 } ]
]
},
"server" : "logab-osx.local:27017"
}
> db.some.find().sort(
).explain()
{
"cursor" : "BtreeCursor a_0 reverse",
"isMultiKey" : false,
"n" : 1,
"nscannedObjects" : 1,
"nscanned" : 1,
"nscannedObjectsAllPlans" : 1,
"nscannedAllPlans" : 1,
"scanAndOrder" : false,
"indexOnly" : false,
"nYields" : 0,
"nChunkSkips" : 0,
"millis" : 0,
"indexBounds" : {
"a" : [
[
,
{ "$minElement" : 1 } ]
]
},
"server" : "logab-osx.local:27017"
}
>
Attachments
Issue Links
- duplicates
-
SERVER-5826 Creating an index using a non-existing plugin should be an error not a warning
-
- Closed
-
-
SERVER-769 Validate top-level & index spec field names for the createIndexes command
-
- Closed
-