Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
what if we didnt install with homebrew?
i am on a windows machine so i couldnt use homebrew. how would i run the mongob and mongo command from my project folder opposed to the bin folder? i tried cd and a relative path all the way to mongo and it still didnt work. when i run it from my bin and i run ls() in mongo shell i see all the files in bin not my project folder. how would i start the shell in my project folder in windows?
Making Mongo available from everywhere
If i got you right you want to execute mongo (mongod, mongodump, ...) in Windows from everywhere in your file system. To do so you have to add the path to your bin folder to the windows PATH environment variable.
To permanently set the environment variable on windows follow the detailed step by step instruction on SO from MatPag.
In Step 9 of the instruction you have to add your path to the bin folder of the mongo installation. After changing the
PATH environment variable (and saving the changes in the control panel) don't forget to restart your machine.
Start the mongo server from where ever you want with
Go into your project folder, where you can now run
to start a mongo shell session. Here you can load the seed script via
from with in the mongo shell.
don't run mongo directly from the folder, just add it to the path and you can execute mongo and mongod just typing it.