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! While you're at it, check out some resources Treehouse students have shared here.

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

Databases Mongo Basics Understanding MongoDB Store Your Blog In Mongo

Derek Derek
Derek Derek
8,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!

3 Answers

Ken Alger
STAFF
Ken Alger
Treehouse 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,
Ken

Cengiz Demir
Cengiz Demir
5,055 Points

Dont use dot.

load('Desktop/(your-parth)/seed.js')