Skip to content

Instantly share code, notes, and snippets.

@scotthernandez
Created December 13, 2010 18:23
Show Gist options
  • Save scotthernandez/739362 to your computer and use it in GitHub Desktop.
Save scotthernandez/739362 to your computer and use it in GitHub Desktop.
> db.bin.find()
> db.bin.save({_id:new BinData(1, "0x01")})
> db.bin.find()
{ "_id" : BinData(1,"0x01") }
> db.bin.save({_id:new BinData(1, "0x02")})
> db.bin.find()
{ "_id" : BinData(1,"0x01") }
{ "_id" : BinData(1,"0x02") }
> db.bin.find({_id:{$gt:new BinData(1, "0x01")}})
{ "_id" : BinData(1,"0x02") }
> db.bin.find({_id:{$gte:new BinData(1, "0x01")}})
{ "_id" : BinData(1,"0x01") }
{ "_id" : BinData(1,"0x02") }
> db.bin.save({_id:new BinData(2, "0x01")})
> db.bin.find({_id:{$gt:new BinData(1, "0x01")}})
{ "_id" : BinData(1,"0x02") }
{ "_id" : BinData(2,"0x01") }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment