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
Derek Derek8,744 Points
load('seed.js') gives an error
I get an error when I try to load seed.js file by using the load("address/seed.js") command..
Hyuns-MacBook-Pro:mongodb-osx-x86_64-3.2.6 HyunJaeCho$ ls
GNU-AGPL-3.0 README bin MPL-2 THIRD-PARTY-NOTICES treehouse-mongo-basics
Hyuns-MacBook-Pro:mongodb-osx-x86_64-3.2.6 HyunJaeCho$ load("treehouse-mongo-basics/seed.js")
-bash: syntax error near unexpected token `"treehouse-mongo-basics/seed.js"'
I am using the correct address and not forgetting to include the address in quote marks.. Am I doing something wrong? Thanks for your help!
Ken AlgerTreehouse Teacher
Your syntax looks basically correct. Is that path name to your
seed.js correct? From within a Mongo Shell you can check your current directory using the
pwd() command and you might, therefore, need to alter your path information.
Post back with further questions and happy coding,
For anyone else that has this error, make sure you are in the mongo shell before running load("seed.js")