Skip to content

Instantly share code, notes, and snippets.

@fabiotatsuo
Last active December 20, 2015 09:40
Show Gist options
  • Save fabiotatsuo/6109973 to your computer and use it in GitHub Desktop.
Save fabiotatsuo/6109973 to your computer and use it in GitHub Desktop.
mongodb
show dbs
use db_name
show collections
#display tables
db.testData.find()
var c = db.testData.find()
while = ( c.hasNext() ) printjson( c.Next() )
var c = db.testData.find()
printjson( c [ 0 ] )
#bring first result
db.testData.findOne()
db.testData.find().limit(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment