Skip to content

Instantly share code, notes, and snippets.

@nm-tran
Last active April 29, 2020 17:22
Show Gist options
  • Save nm-tran/bace3c672b38972c23c988f42bacc7de to your computer and use it in GitHub Desktop.
Save nm-tran/bace3c672b38972c23c988f42bacc7de to your computer and use it in GitHub Desktop.

My MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

db

Create Or Switch Database

use claim-now

Show Collections

show collections

Get All Rows From A Collection "users"

db.users.find().pretty()

Drop

db.dropDatabase()

Create Collection

db.createCollection('posts')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment