Skip to content

Instantly share code, notes, and snippets.

@westonplatter
Created August 11, 2012 15:10
Show Gist options
  • Select an option

  • Save westonplatter/3325188 to your computer and use it in GitHub Desktop.

Select an option

Save westonplatter/3325188 to your computer and use it in GitHub Desktop.
mongoid
> mongo
// saving records
db.test.save({"a": 1}) //
db.test.find() // { "_id" : ObjectId("502437b4a1d603739ab59206"), "a" : 1 }
db.test.save({"a": 100}) //
// retreaving range of records
db.test.find( { "a": { $gt: 0, $lt: 500 } } ) // { "_id" : ObjectId("502437b4a1d603739ab59206"), "a" : 1 }
// { "_id" : ObjectId("502675b7792a4a17c3b470b6"), "a" : 100 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment