Difference between revisions of "Mongo (command)"

From wikieduonline
Jump to navigation Jump to search
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{lowercase}}
 
https://docs.mongodb.com/manual/reference/program/mongo/
 
https://docs.mongodb.com/manual/reference/program/mongo/
 +
* <code>[[mongo --help]]</code>
 +
* <code>[[mongo yourlocaldbname]]</code>
 +
* <code>mongo --host IP_TO_CONNECT</code>
 +
* <code>[[mongo]] --eval "[[printjson]](db.serverStatus())"</code>
 +
* <code>[[mongo]] < file_with_commands.txt</code>
 +
 +
  
 +
== Errors ==
 
<pre>
 
<pre>
 
mongo
 
mongo
Line 12: Line 21:
 
</pre>
 
</pre>
  
 
 
* <code>[[mongo]] --eval "printjson(db.serverStatus())"</code>
 
 
* <code>mongo --host IP_TO_CONNECT</code>
 
  
  
 
== Related commands ==
 
== Related commands ==
* <code>[[mySQL]]</code>
+
* <code>[[MySQL]]</code>
 
* <code>[[MongoDB Compass]]</code> GUI for MondoDB
 
* <code>[[MongoDB Compass]]</code> GUI for MondoDB
 +
* <code>[[mongodump]]</code>
  
 
== See also ==
 
== See also ==
 +
* {{mongo}}
 
* {{mongoDB}}
 
* {{mongoDB}}
  
 
[[Category:MongoDB]]
 
[[Category:MongoDB]]

Latest revision as of 20:14, 7 March 2024

https://docs.mongodb.com/manual/reference/program/mongo/


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]

See also[edit]

Advertising: