Skip to content

Instantly share code, notes, and snippets.

@samueleastdev
Last active November 7, 2017 15:00
Show Gist options
  • Select an option

  • Save samueleastdev/72fe44d9fed0401d644161b2c5807111 to your computer and use it in GitHub Desktop.

Select an option

Save samueleastdev/72fe44d9fed0401d644161b2c5807111 to your computer and use it in GitHub Desktop.
Mongo Database Helper Commands
# Shutdown already running database instances
ps ax | grep mongod
kill -9 0000
# show databases
show dbs
# Switch current database to
use <db>
# Print a list of all collections for current database
show collections
# Print a list of users for current database.
show users
# Insert a value into users collection
db.users.insert({name: 'billy'})
# List all data in the users collection
db.users.find()
# Error: listen EADDRINUSE :::3000 fix
killall -9 node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment