Skip to content

Instantly share code, notes, and snippets.

@adamw
Created May 10, 2013 14:06
Show Gist options
  • Save adamw/5554606 to your computer and use it in GitHub Desktop.
Save adamw/5554606 to your computer and use it in GitHub Desktop.
> db.x.find()
{ "_id" : ObjectId("518cfe49a04a86d494396a96"), "a" : "20130430" }
{ "_id" : ObjectId("518cfe4ba04a86d494396a97"), "a" : "20130431" }
{ "_id" : ObjectId("518cfe4fa04a86d494396a98"), "a" : "20130501" }
{ "_id" : ObjectId("518cfe57a04a86d494396a99"), "a" : "20131001" }
{ "_id" : ObjectId("518cfe81a04a86d494396a9a"), "a" : "20130520" }
> db.x.find({"a": {"$lt": "20130501"}})
{ "_id" : ObjectId("518cfe49a04a86d494396a96"), "a" : "20130430" }
{ "_id" : ObjectId("518cfe4ba04a86d494396a97"), "a" : "20130431" }
> db.x.find({"a": {"$gt": "20130501"}})
{ "_id" : ObjectId("518cfe57a04a86d494396a99"), "a" : "20131001" }
{ "_id" : ObjectId("518cfe81a04a86d494396a9a"), "a" : "20130520" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment