I am using mongoDB and am curious to whether you can import scripts like you can in MySQL:
mysql -uuser -ppassword database < script.sql
Can you do this with mongoDB?
Cheers
Eef
You can pass a list of JS files to the mongo JavaScript shell and those will get executed:
$ echo "print('hello');" > test.js
$ ./mongo test.js
MongoDB shell version: 1.3.2-
url: test
connecting to: test
hello
You can use the normal mongo command line arguments if you need to specify a specific db, username, or password like you do in your above example.
I think you need to use a library like PyMongo to access the db, but after installing you should be able to script aggainst the mongoDB very well using python.