Skip to content

Instantly share code, notes, and snippets.

@bbrochier
Last active August 29, 2015 14:21
Show Gist options
  • Save bbrochier/e05599943e2deef74086 to your computer and use it in GitHub Desktop.
Save bbrochier/e05599943e2deef74086 to your computer and use it in GitHub Desktop.
MongoDB notes

#MongoDB

MongoLab import/export

Export from local

  1. stop mongod
  2. mkdir backup folder
  3. cd backup folder
  4. Run mongodump --dbpath /Users/benoitbrochier/Sites/collective/data

Import to MongoLab

  1. mongorestore -h ds039301.mongolab.com:39301 -d collective -u <username> -p <pass> /Users/benoitbrochier/Sites/collective/backup/dump/collective-dev

Mongo express (GUI)

To have a graphic view of your database. https://www.npmjs.com/package/mongo-express

Go to

/usr/local/lib/node_modules/mongo-express/

Run

node app

View at http://localhost:8081

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment