-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
Labels:None
-
ALL
See: http://groups.google.com/group/mongodb-user/browse_thread/thread/7a67b122e4bf495a
I don't know if this a feature of multikeys or what but it seems wrong...
Imagine I have a collection with documents that look like this:
{
name: "Test"
details: [
,
{ timestamp: 1320083200000, type: "something else" } ]
}
These commands will create one of those documents, index it, and then explain a query:
db.testdocuments.insert({name: "Test", details: [
{timestamp: 1319083200000, type: "something"},
{timestamp: 1320083200000, type: "something else"}]})
db.testdocuments.ensureIndex(
)
db.testdocuments.find({'details.timestamp': {$gte:
1319083200000, $lte: 1319093200000}}).explain()
{
"cursor" : "BtreeCursor details.timestamp_1",
"nscanned" : 404081,
"nscannedObjects" : 404081,
"n" : 3494,
"millis" : 3063,
"nYields" : 455,
"nChunkSkips" : 0,
"isMultiKey" : true,
"indexOnly" : false,
"indexBounds" :
}
NOTE the upper bound is messed up...
If I do a descending index the lower bound is messed up.
Also, note that if you create a document that only has one element in the details array the index bounds are correct.