1. upload your script.js to the server
2. ssh directly into it
3. execute mongo localhost:27017/database_name script.js
Since the mongo shell is opened on the server, the script will run on it.
The tradeoff is that while the script is running, it will create a resource
contention in the server with the mongod process. Please ensure that this
tradeoff is acceptable before deploying this method into production.
You received this message because you are subscribed to the Google Groups "mongodb-user"