Cheatography
https://cheatography.com
I created this cheatsheet to stop searching the Internet when having to come back to MongoDB since I do not work with it everyday.
Installation
Install XCode |
xcode-select --install |
Homebrew tap |
brew tap mongodb/brew |
Homebrew update |
brew update |
Homebrew install latest |
brew install mongodb-community |
Homebrew install specific version |
|
configuration file |
/usr/local/etc/mongod.conf |
log directory |
/usr/local/var/log/mongodb |
create data directory |
/usr/local/var/mongodb |
/usr/local/etc/mongod.conf
processManagement: |
|
fork: true |
net: |
|
bindIp: localhost |
|
port: 27017 |
storage: |
|
dbPath: /usr/local/var/mongodb |
systemLog: |
|
destination: file |
|
path: "/usr/local/var/log/mongodb/mongod.log" |
|
logAppend: true |
storage: |
|
journal: |
|
enabled: true |
clients
Terminal |
mongosh |
Studio 3T |
MongoDB Compass |
Robo 3T |
NoSQLBooster |
HumongouS.io |
NoSQL Manager |
DronaHQ |
MongoDB Database Tools |
|
|
Is MongoDB Running?
check if running on port |
lsof -i tcp:27017 |
check if process running |
ps -ax | grep mongo |
MongoDB Community Edition as service
start mongo db service |
brew services start mongodb-community |
start specific mongo db version |
|
stop mongo db service |
brew services stop mongodb-community |
MongoDB Community Manual
start manually |
mongod --config /usr/local/etc/mongod.conf --fork |
stop mongdb step 1 |
mongsh |
stop mongodb step 2 |
use admin |
stop mongodb step 3 |
db.shutdown() |
Troubleshooting
Client Connection Refused Error |
MongoDB is not running |
MongoDB cannot run on port |
sudo rm /tmp/mongodb-27017.sock |
Check logs |
cat /usr/local/var/log/mongodb/mongod.log |
MongoDB Cannot run missing data directory |
mkdir /usr/local/var/mongodb |
MacOS Prevents mongosh Running |
System Prefereces > Security & Privacy > General > Open Anyway or Allow Anyway |
|
Created By
https://www.linkedin.com/in/slobodanlohja
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
More Cheat Sheets by slohja