Hello everyone,
I am using MongoDB under Ubuntu 12.04 and Ubuntu 14.04. I want to index my database [1] on the field "transforms.header.stamp" of type Date (not Array). When I ask MongoDB to explain my query, MongoDB answers that the field "isMultiKey" is set to "True". This should happen only when the field "transforms.header.stamp" contains an Array (which is not the case of my database). If I ask MongoDB to print the field "transforms.header.stamp" it prints no array at all.
Here is a short summary of the steps I am doing:
1. importing my database
mongoimport --db roslog --collection tf tf.json
connected to: 127.0.0.1
imported 1 objects
2. building the index:
mongo roslog --eval 'db.tf.ensureIndex( { "transforms.header.stamp" : 1 } )'
MongoDB shell version: 2.0.4
connecting to: roslog
3. asking my querry:
db.tf.find( { "transforms.header.stamp":
{ $lt: new Date(1396512603500),
$gt: new Date(1396512602000) } } ).explain(1)
4. getting the answer:
{
"cursor" : "BtreeCursor transforms.header.stamp_1",
"nscanned" : 0,
"nscannedObjects" : 0,
"n" : 0,
"millis" : 0,
"nYields" : 0,
"nChunkSkips" : 0,
"isMultiKey" : true,
"indexOnly" : false,
"indexBounds" : {
"transforms.header.stamp" : [
[
true,
ISODate("2014-04-03T08:10:03.500Z")
]
]
},
"allPlans" : [
{
"cursor" : "BtreeCursor transforms.header.stamp_1",
"indexBounds" : {
"transforms.header.stamp" : [
[
true,
ISODate("2014-04-03T08:10:03.500Z")
]
]
}
}
],
"oldPlan" : {
"cursor" : "BtreeCursor transforms.header.stamp_1",
"indexBounds" : {
"transforms.header.stamp" : [
[
true,
ISODate("2014-04-03T08:10:03.500Z")
]
]
}
}
}
Could you please try to import my small database [1] and check whether you can reproduce this behavior?
Do you have an idea why this happens?
Many thanks in advance!
Cheers,
Gheorghe
[1] tf.json