[solaris][bug] Date range queries not cross unix epoch boundary

71 views
Skip to first unread message

Joshua Hanson

unread,
Sep 16, 2011, 4:31:54 PM9/16/11
to mongodb-dev, d...@nerve.com
mongodb 2.0.0 solaris binary

> db.dates.find()
{ "_id" : ObjectId("4e73b1a0be44c4f0efc6d6f6"), "dob" :
ISODate("1950-02-01T00:00:00Z") }
{ "_id" : ObjectId("4e73b1a3be44c4f0efc6d6f7"), "dob" :
ISODate("1960-02-01T00:00:00Z") }
{ "_id" : ObjectId("4e73b1a5be44c4f0efc6d6f8"), "dob" :
ISODate("1970-02-01T00:00:00Z") }
{ "_id" : ObjectId("4e73b1aabe44c4f0efc6d6f9"), "dob" :
ISODate("1980-02-01T00:00:00Z") }
{ "_id" : ObjectId("4e73b1acbe44c4f0efc6d6fa"), "dob" :
ISODate("1990-02-01T00:00:00Z") }

> db.dates.find({dob:{$lt: new Date(2000,1,1)}})
{ "_id" : ObjectId("4e73b1a5be44c4f0efc6d6f8"), "dob" :
ISODate("1970-02-01T00:00:00Z") }
{ "_id" : ObjectId("4e73b1aabe44c4f0efc6d6f9"), "dob" :
ISODate("1980-02-01T00:00:00Z") }
{ "_id" : ObjectId("4e73b1acbe44c4f0efc6d6fa"), "dob" :
ISODate("1990-02-01T00:00:00Z") }

> db.dates.find({dob:{$gt: new Date(1940,1,1)}})
{ "_id" : ObjectId("4e73b1a0be44c4f0efc6d6f6"), "dob" :
ISODate("1950-02-01T00:00:00Z") }
{ "_id" : ObjectId("4e73b1a3be44c4f0efc6d6f7"), "dob" :
ISODate("1960-02-01T00:00:00Z") }

How long will it take to get a patch for this?

Eliot Horowitz

unread,
Sep 17, 2011, 1:17:00 AM9/17/11
to mongo...@googlegroups.com
Was the index created with a 2.0.0 binary?
Can you do db.dates.getIndexes()
v0 indexes won't handle this correctly, v1 should

> --
> You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
> To post to this group, send email to mongo...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-dev...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-dev?hl=en.
>
>

Joshua Hanson

unread,
Sep 17, 2011, 4:50:38 PM9/17/11
to mongodb-dev
> db.dates.getIndexes()
[
{
"name" : "_id_",
"ns" : "test.dates",
"key" : {
"_id" : 1
},
"v" : 0
}
]

how do I get v1?
does this mean 2.0.1 or something else?
This is solaris 64bit binary btw.

Scott Hernandez

unread,
Sep 17, 2011, 4:57:48 PM9/17/11
to mongo...@googlegroups.com
What does db.serverBuildInfo() say?

Eliot Horowitz

unread,
Sep 17, 2011, 5:52:43 PM9/17/11
to mongo...@googlegroups.com
You need to do a db.dates.reIndex() with a 2.0.0 binary to get the new index.
It could take a while if the data set is large.
Reply all
Reply to author
Forward
0 new messages