I'm using vagrant and trying to create some bash sentences to initialize my vagrant local machine like the server configuration:
I'm installing Mongo and everything was ok untill i need to create the database and some collections: I would like to do that:
mongo
use redirect
db.createCollection("first")
db.createCollection("second")
db.createCollection("third")
exit
From my terminal and conecting to the machine with ssh is working, but i would like to make this process automatic, i have try to run the code exactly like above and is not working. Or something like:
mongo --shell use redirect
mongo --shell db.createCollection("first")
If somebody knows how to do this i will appreciate some help.
Thanks in advance.