evanlucas / learnyoumongo

MongoDB workshop.
MIT License
306 stars 89 forks source link

count exercise: no parrots collection #33

Open eugenehiggins opened 8 years ago

eugenehiggins commented 8 years ago

My code is almost exactly like the solution code, but returns no documents. Going into the mongo console I ran show collections. The only collections were docs, system.indexes, and users, but no parrots. I restarted mongod in one terminal (mongod --port 27017 --dbpath=./data --nojournal), and mongo in the next terminal and parrots did show up.

If anyone else is having this issue you may need to restart the db.

mientje commented 8 years ago

I'm working on the count exercise. My own soluction I think is correct, I see no errors but it just wont run. I even copied the solution code Evan Lucas provides in my js file and I still can't run it. EMs all over the place and each time I see something about 'db.collection('parrots').remove({}, function(err) {' blablabla. Remove? I did that exercise or am I not getting it? All I know is fcc, I'm very very new at this. I think I have restarted that db several times. (I repeat exercise 2). I always get 'sucessfully installed' and that's it. Maybe it's my pc.

dospunk commented 7 years ago

I'm having this issue with the Find exercise I think. I tried running a find that would get everything, just to test if things were working, but the array printed is blank.

DreamHazard commented 6 years ago

I was able to fix this issue by deleting the files from the data folder and restarting mongod, then running learnyoumongo verify on my js file.

Not sure what was causing the issue but this resolved it.

Further verification can be gained by running mongo learnyoumongo and then show collections from the mongo prompt.

If you can see the collection via the mongo prompt but not from your js file then there may be something wrong with your code.