How to load initial data in MongoDB?
You can use the mongoimport tool that comes with MongoDB to import raw data.
To run scripts from a file, e.g. to recreate indexes, pass the file name as a command line argument:
mongo file.js "another file.js"
./mongo server:27017/dbname --quiet my_commands.js
In my_commands.js:
db.users.insert({name:"john", email:"[email protected]", age:12});