Closed camreon closed 10 years ago
Open another terminal and run 'mongod' before running node.
I also got this after sending a few requests in a row and the server crashed sometimes, idk, but everything was fine after starting it up again.
jk, I get this:
TypeError: Cannot call method 'collection' of null
at /Users/patrick/Documents/Code/pow-viz/data_aggregator.js:118:23
at /Users/patrick/Documents/Code/pow-viz/node_modules/mongodb/lib/mongodb/mongo_client.js:372:11
at process._tickCallback (node.js:415:13)
not a huge issue but I'm curious why that happens
oh, yea that's what i was getting before putting an error check in. must be the same problem
this is the error producing line: var collection = db.collection(self.collection);
i guess the db isn't getting initialized properly. not sure why, but we can def figure it out in class tomorrow. everything was working for me when i tested, must just be some minor difference in our setups.
this thing : localhost:27017 is usually the port that mongod is running on, which is what was making me think mongod was not running when you guys were getting the errors.
oh and it might be a problem if the collection hasn't already been created in mongodb.. i ran the csv importer and had all the data put into a collection named 'weed_data' I'm not sure if you guys had that collection yet.
I have it working most of the time, it's just if I send multiple API requests quickly. I'll see if I can look something up about it.
fixed this by opening one mongo connection when initializing DataAggregator.
i keep getting this connection error in data_aggregator.js from
i'm pretty sure i have mongodb installed. any ideas what's going on?