-
Notifications
You must be signed in to change notification settings - Fork 1
MongoDB platform specific notes
LHCGreg edited this page Dec 30, 2013
·
4 revisions
- mongo scripts are .js javascript files that dbsc uses the
mongo
command line application to run.mongo
must be on your PATH.
A script might look like this:
db.createCollection('books');
db.books.ensureIndex({ name: 1 });
db.books.insert(
[
{
name: 'Charlie and the Chocolate Factory',
author: 'Roald Dahl'
}
]
);
- Imports are done via
mongodump
/mongorestore
for each collection.mongodump
andmongorestore
must be your PATH to import data from another database. - Because a collection must be destroyed before importing with
mongorestore
, you will lose indexes on imported collections and get whatever indexes the source database has on the collection. This differs from every other dbsc flavor.