Last active
June 8, 2019 10:44
-
-
Save joaoceron/256a6ede60669fcd6f9b0fab51690418 to your computer and use it in GitHub Desktop.
mongodb notes
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 database | |
mongo admin --host localhost -u admin -p admin --eval "db.getSiblingDB('mydb');" | |
use mydb | |
db.createUser( { user: "user1", pwd: "pass", roles: [ "readWrite", "dbAdmin" ], passwordDigestor:"server" } ) | |
db.createCollection("log", { capped : true, size : 5242880, max : 5000 } ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment