Skip to content

Instantly share code, notes, and snippets.

@jesselima
Last active November 13, 2017 12:04
Show Gist options
  • Save jesselima/5d5240362aba8640c425eb2e491529b6 to your computer and use it in GitHub Desktop.
Save jesselima/5d5240362aba8640c425eb2e491529b6 to your computer and use it in GitHub Desktop.
mongo
// Select database
use database_name
// Create Collections
db.createColletction('collection_name')
// See collections in a database
show collections
// insert data into a collection
db.book.insert({"title" : "abc", "authr" : "xyz", "price" : 123})
// Select documents in a collection
db.book.find()
// Show selected documents JSON like visual
db.book.find().pretty()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment