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

Harshay Raipancholi
seal-mask
.a{fill-rule:evenodd;}techdegree
Harshay Raipancholi
Python Development Techdegree Student 11,521 Points

load() doesn't work on windows

I get the following error when I run load('c:\Program Files\MongoDB\data\db\seed.js') , can someone help?

load('c:\Program Files\MongoDB\data\db\seed.js') 2018-09-27T14:25:29.840+0100 E - [js] file [c:Program FilesMongoDBdatadbseed.js] doesn't exist 2018-09-27T14:25:29.841+0100 E QUERY [js] Error: error loading js file: c:Program FilesMongoDBdatadbseed.js : @(shell):1:1

1 Answer

Richard Rowland
Richard Rowland
16,574 Points

You need to use forward slashes rather than backslashes. Mongo doesn't recognise the backslash in directory paths even though you're using Windows. That's why they're missing in the error message "Error: error loading js file: c:Program FilesMongoDBdatadbseed.js".