amark / mongous

Simple MongoDB driver for Node.js with jQuery like syntax.
MIT License
246 stars 30 forks source link

Mongous does not wait for connected #3

Closed ChromoX closed 13 years ago

ChromoX commented 13 years ago

Sometimes the very first db('db.col').find(function(reply) {}) I do never calls the callback function.

For example: var db = require('./mongous/mongous.js').Mongous; db('db.col').find(function(reply) { console.log('Reply: ' + reply); });

If you run that by itself sometimes it will or will not return what you were looking for.

mellomike commented 13 years ago

I'm having this same problem.

peet86 commented 13 years ago

The same here.. Has anybody solved this find() reply issue?

amark commented 13 years ago

Wow, sorry, I've been so busy on my other projects I've missed a lot of stuff over here on github. I've been aware of this problem for quite some time, it is specific to find().

Untill I fix it (or somebody pitches in and fixes it), here is a solution I sent somebody else a few months ago: Note: there is a small bug that it won't perform find() lookups if they are the first command in the code. I probably won't fix this for a while (and I need to update the readme). To fix this, just explicitly call db('').open()

once again, sorry for the horrible delay. I'd love to get help! :)