-
Notifications
You must be signed in to change notification settings - Fork 0
MongoDB Notes
cdhop edited this page Sep 4, 2014
·
10 revisions
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).
A MongoDB server's configuration is specified in the '/etc/mongodb.conf' file.
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
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