mongo (command)
Jump to navigation
Jump to search
https://docs.mongodb.com/manual/reference/program/mongo/
mongo --help
mongo yourlocaldbname
mongo --host IP_TO_CONNECT
mongo --eval "printjson(db.serverStatus())"
mongo < file_with_commands.txt
Errors[edit]
mongo MongoDB shell version v4.2.5 connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb 2020-04-12T11:29:06.534+0000 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: Connection refused : connect@src/mongo/shell/mongo.js:341:17 @(connect):2:6 2020-04-12T11:29:06.536+0000 F - [main] exception: connect failed 2020-04-12T11:29:06.536+0000 E - [main] exiting with code 1
Related commands[edit]
MySQL
MongoDB Compass
GUI for MondoDBmongodump
See also[edit]
Advertising: