Skip to content

Instantly share code, notes, and snippets.

@ggoodale
Created February 10, 2010 21:33
Show Gist options
  • Save ggoodale/300874 to your computer and use it in GitHub Desktop.
Save ggoodale/300874 to your computer and use it in GitHub Desktop.
Using $gt instead of $ne
> db.users.find({last_logged_in : {'$gt': null}}).explain()
{
"cursor" : "BtreeCursor last_logged_in_1",
"startKey" : {
"last_logged_in" : null
},
"endKey" : {
"last_logged_in" : {
"$maxElement" : 1
}
},
"nscanned" : 536361,
"n" : 0,
"millis" : 352,
"allPlans" : [
{
"cursor" : "BtreeCursor last_logged_in_1",
"startKey" : {
"last_logged_in" : null
},
"endKey" : {
"last_logged_in" : {
"$maxElement" : 1
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment