Skip to content

Instantly share code, notes, and snippets.

@joaoceron
Last active June 8, 2019 10:44
Show Gist options
  • Save joaoceron/256a6ede60669fcd6f9b0fab51690418 to your computer and use it in GitHub Desktop.
Save joaoceron/256a6ede60669fcd6f9b0fab51690418 to your computer and use it in GitHub Desktop.
mongodb notes
# 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