mongo: Add page (#994)

* mongo: Add page

* Addressing comments
waldyrious/alt-syntax
Agniva De Sarker 2016-08-08 12:34:25 +05:30 committed by Leandro Ostera
parent 9c5450feac
commit 0d2e70625e
1 changed files with 19 additions and 0 deletions

19
pages/common/mongo.md Normal file
View File

@ -0,0 +1,19 @@
# mongo
> MongoDB interactive shell client.
- Connect to a database:
`mongo {{database}}`
- Connect to a database running on a given host on a given port:
`mongo --host {{host}} --port {{port}} {{database}}`
- Connect to a database with a given username; user will be prompted for password:
`mongo --username {{username}} {{database}} --password`
- Evaluate a javascript expression on the database:
`mongo --eval '{{JSON.stringify(db.foo.findOne())}}' {{database}}`