Created
August 9, 2020 18:54
-
-
Save luke-h1/34f476c610e192bd9620f8b659dff283 to your computer and use it in GitHub Desktop.
mongodb commands
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
create user & add role: | |
```db.createUser({ user: "username", pwd "password", roles:[role: "userAdminAnyDatabase", db: "admin" }]}) ``` | |
create db: | |
```use <db name here> ``` | |
show collections: | |
```show collections ``` | |
create collection: | |
```db.collection_name.insert ({ )} ``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment