Skip to content

Instantly share code, notes, and snippets.

@ggoodale
Created February 10, 2010 21:56
Show Gist options
  • Save ggoodale/300896 to your computer and use it in GitHub Desktop.
Save ggoodale/300896 to your computer and use it in GitHub Desktop.
Same query with a date obj in the $gt clause.
> db.users.find({last_logged_in : {'$gt': new Date(0)}}).explain()
{
"cursor" : "BtreeCursor last_logged_in_1",
"startKey" : {
"last_logged_in" : "Wed Dec 31 1969 16:00:00 GMT-0800 (PST)"
},
"endKey" : {
"last_logged_in" : "Tue Jan -2147483647 584556020 06:25:52 GMT-0800 (PST)"
},
"nscanned" : 8,
"n" : 8,
"millis" : 0,
"allPlans" : [
{
"cursor" : "BtreeCursor last_logged_in_1",
"startKey" : {
"last_logged_in" : "Wed Dec 31 1969 16:00:00 GMT-0800 (PST)"
},
"endKey" : {
"last_logged_in" : "Tue Jan -2147483647 584556020 06:25:52 GMT-0800 (PST)"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment