Skip to content
cdhop edited this page Sep 4, 2014 · 10 revisions

Description

  • MongoDB is a BSON/JSON-based document database.
  • Each document is a JSON object.
  • 'Documents' are kept in 'collections', and a 'database' can have several 'collections'.
  • MongoDB enforces no schema, therefore each document may contain a unique set of fields/attributes (even if they are in the same collection).

Configuration

A MongoDB server's configuration is specified in the '/etc/mongodb.conf' file.

Export Data

One way to export data from MongoDB is the 'mongoexport' command. Here's an example:

$ mongoexport --host 127.0.0.1 --db mydb --collection customers > customers.json

Import Data

One way to import data into MongoDB is the 'mongoimport' command. Here's an example:

$ mongoimport -- host 127.0.0.1 --db mydb --collection customers --file customers.json

Clone this wiki locally