Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Import a bson file into your Mongo /data/ folder: mongorestore -d db_name -c collection_name "C:\path\to\export.bson"
    • Make sure to add your MongoDB's 'bin' folder to the PATH to get mongorestore to work from a command prompt.
  • Run Mongod: "C:\Program Files\MongoDB\Server\4.0\bin\mongod.exe" --dbpath="c:\data\db"
  • Run MongoDB shell: "C:\Program Files\MongoDB\Server\4.0\bin\mongo.exe"
  • Show list of dbs: 'show dbs'
  • Switch to using a particular db: 'use <db>'
  • Show list of collections for the active db: 'show collections'
  • Get all records from a particular collection once you're switched to a particular db: 'db.<collection_name>.find()'

...