Is this possible to write the query result to the file from mongo js script. I have searched a lot, but I didn\'t find any solution.
ex:-
cursor = db
http://www.mongodb.org/display/DOCS/Scripting+the+shell paragraph "Differences between scripted and interactive/ Printing".
./mongo server.com/mydb --quiet --eval "db.users.find().forEach(printjson);" > 1.txt