Last active
November 7, 2017 15:00
-
-
Save samueleastdev/72fe44d9fed0401d644161b2c5807111 to your computer and use it in GitHub Desktop.
Mongo Database Helper Commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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