forked from tldr-pages/tldr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* mongo: Add page * Addressing comments
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}}` |