New to this forum, to mongodb , My goal is to automate a database creation from a linux BATCH on a computer client to the server.
conn = new mongo(); "returns OK"
db = conn.getDB("admin"); "returns OK"
db.runCommand( { use NewDatabase } ) "returns *NOK* , this is not the good syntax "
Can't found the way in the Shell Helper , or perhaps i missed it in mongodb help: http://docs.mongodb.org/manual/tutorial/write-scripts-for-the-mongo-shell/
Is there is a solution or do i have to use Py -Pymongo or an another language?
Thank you, sorry for the first post i was not a really nice post.
use dbnamein your command-line javascript, that won't work (it's interactive syntax only). For tips see: Write Scripts for themongoShell and in particular note the differences between interactive and scripted mode. You might also be interested in the MongoDB manual examples discussing how to Model Tree Structures.