mongo (command)

From wikieduonline
(Redirected from Mongo)
Jump to navigation Jump to search

mongo --help
MongoDB shell version v4.2.5
connecting to: mongodb://
2020-04-12T11:29:06.534+0000 E  QUERY    [js] Error: couldn't connect to server, connection attempt failed: SocketException: Error connecting to :: caused by :: Connection refused :
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

  • mongo --eval "printjson(db.serverStatus())"
  • mongo < file_with_commands.txt
  • mongo --host IP_TO_CONNECT

Related commands[edit]

See also[edit]