Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do you run a mongo shell script with a deployed meteor app?

With mongo you can write scripts that get passed into the shell like:

mongo myDB script.js

http://docs.mongodb.org/manual/tutorial/write-scripts-for-the-mongo-shell/

but to access the mongo shell of a deployed meteor app is says to do the following:

meteor mongo myApp.meteor.com

I can't pass the script file with this statement like so:

 meteor mongo myApp.meteor.com script.js

because my deployed app is password protected and the above statement feeds script.js into the password prompt.

So the question is how would you do this?

Alternatively how can you connect to a deployed meteor app's mongo shell without using meteor?

like image 954
funkyeah Avatar asked Dec 27 '22 02:12

funkyeah


1 Answers

Get the instance's login details via meteor mongo myapp.meteor.com --url. You'll get something that should match up to

mongodb://username:password@host:port/databasename

Which you can use to login via mongo on your computer. Be aware the login details last for only 1 minute by which time you need to meteor mongo --url again

mongo host:port/databasename -u username -p password yourscript.js
like image 189
Tarang Avatar answered May 04 '23 18:05

Tarang