Skip to content

Instantly share code, notes, and snippets.

@xotonic
Last active May 31, 2017 09:10
Show Gist options
  • Save xotonic/372bcfc851ba6535d01f925239927471 to your computer and use it in GitHub Desktop.
Save xotonic/372bcfc851ba6535d01f925239927471 to your computer and use it in GitHub Desktop.
mongo

User for mongobackup and mongorestore in 2.4

rs1:PRIMARY> db.addUser({ user: "pcrfems", pwd: "123", roles: [ 'read', 'userAdmin']})
{
	"user" : "pcrfems",
	"pwd" : "cd4ccf44c3f7fe667fc05ae38396a94b",
	"roles" : [
		"readWrite",
		"userAdmin"
	],
	"_id" : ObjectId("592e82577754d73eb31ad4b0")
}

>mongodump -h 172.17.0.2 -u pcrfems -p 123 -d pcrf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment