mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 14:22:07 +02:00

Co-authored-by: marchersimon <50295997+marchersimon@users.noreply.github.com> Co-authored-by: Seth Falco <seth@falco.fun> Co-authored-by: Patrice Denis <patricedenis@users.noreply.github.com>
554 B
554 B
mongo
MongoDB interactive shell client. More information: https://docs.mongodb.com/manual/reference/program/mongo.
- 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}}