-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.8.0
-
Component/s: None
-
Environment:Debian linux
ruby 1.9.3
I have a collection, the data structure:
{ "_id" :
{ "h" : NumberLong("331673610000000"), "s" : ISODate("2011-01-10T05:05:00Z") }, "intervals" : [ ] }
There is an index on _id.s:
mongos> db.readings.getIndexes()
[
{
"v" : 1,
"key" :
,
"ns" : "fivemin.readings",
"name" : "id"
},
{
"v" : 1,
"key" :
,
"ns" : "fivemin.readings",
"name" : "_id.s_1",
"background" : true
}
]
in the shell I am able to query for information using this index:
mongos> db.readings.find(
).count()
13135
With the ruby driver my queries return an empty set:
db['readings'].find("_id.s" =>
{"$gte" => start_date, "$lte" => start_date} ).count()
=> 0
Is this a defect? Should I be writing the ruby query differently?