|
|
|
@ -1,3 +1,6 @@
|
|
|
|
|
# mongo
|
|
|
|
|
# MongoDB interactive shell client.
|
|
|
|
|
|
|
|
|
|
# Connect to local host on default port 27017
|
|
|
|
|
mongo
|
|
|
|
|
|
|
|
|
@ -18,6 +21,9 @@ mongo --shell my-script.js
|
|
|
|
|
# and execute my-script.js after that
|
|
|
|
|
mongo localhost:27017/myDatabase my-script.js
|
|
|
|
|
|
|
|
|
|
# Evaluate a javascript expression on the database:
|
|
|
|
|
mongo --eval 'JSON.stringify(db.foo.findOne())' database
|
|
|
|
|
|
|
|
|
|
# See also:
|
|
|
|
|
# MongoDB cheat sheets at /mongo/
|
|
|
|
|
# list of pages: /mongo/:list
|
|
|
|
|