Last active
November 8, 2022 05:27
-
-
Save hochun836/29124a9a84b5f8446f42aac207d5ae1f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# mongo shell | |
mongosh -h | |
mongosh --version | |
mongosh <db-address> | |
mongosh mongodb://<ip> | |
mongosh mongodb://<ip>:<port> | |
mongosh mongodb://<ip>:<port>/<db> | |
mongosh --host <ip> | |
mongosh --host <ip> --port <port> | |
mongosh --nodb // don't connect to mongod on startup - no 'db address' [arg] expected | |
inside mongo shell, | |
> help | |
> version() | |
> print("Hello World") | |
> isInteractive() | |
> cls | |
> exit // <=> exit() <=> .exit | |
> show profile // print system.profile information | |
> show dbs // <=> show databases | |
> use <db> | |
> show collections // <=> show tables, for current database | |
> show users // for current database | |
> show roles // for current database | |
NOTE: installation | |
=> ref: https://www.mongodb.com/docs/mongodb-shell/install/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment