Skip to content

Instantly share code, notes, and snippets.

@luke-h1
Created August 9, 2020 18:54
Show Gist options
  • Save luke-h1/34f476c610e192bd9620f8b659dff283 to your computer and use it in GitHub Desktop.
Save luke-h1/34f476c610e192bd9620f8b659dff283 to your computer and use it in GitHub Desktop.
mongodb commands
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