ThatDevGuy
ThatDevGuy

Reputation: 13

Can't load js into MongoDB

Trying to get this project to run locally.

NPM is installed. Mongo is running, but can't load the seed files.

Using mac OSX, my terminal output is:

curtiss-mbp:CustomerManager curtiss$ mongo
MongoDB shell version: 2.7.4
connecting to: test
Server has startup warnings: 
2014-08-16T18:28:54.115-0400 [initandlisten] 
2014-08-16T18:28:54.115-0400 [initandlisten] ** NOTE: This is a development version (2.7.4) of MongoDB.
2014-08-16T18:28:54.115-0400 [initandlisten] ** Not recommended for production.
2014-08-16T18:28:54.115-0400 [initandlisten] 
2014-08-16T18:28:54.115-0400 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2014-08-16T18:28:54.115-0400 [initandlisten]

use custmgr
switched to db custmgr
load("initMongoCustData.js")
2014-08-16T18:40:33.956-0400 Error: remove needs a query
at Error ()
at DBCollection.remove (src/mongo/shell/collection.js:299:31)
at initMongoCustData.js:65:14
at (shell):1:1 at src/mongo/shell/collection.js:299
2014-08-16T18:40:33.956-0400 Error: error loading js file: initMongoCustData.js
at (shell):1:1

It fails to load the js into MongoDB. Am I missing something or doing something incorrectly?

Upvotes: 1

Views: 2544

Answers (1)

Gergo Erdosi
Gergo Erdosi

Reputation: 42048

Line 65 in initMongoCustData.js should be changed from

db.customers.remove();

to

db.customers.remove({});

Upvotes: 3

Related Questions