-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot call method 'findOne' of null at MongoStore.get #48
Comments
Yup. Ditto here. It seemed completely broken. Turned out I was not calling the constructor properly. Old example code strikes again. I thought I should use |
Caught me as well. Old, confusing docs. |
same prob, any news here? |
@kof the solution by danmactough with db url as parameter works for me, too. |
my issue was, that connection was used before it is ready, after I started to use a callback it stoped throw errors. I suppose queries will not be queued until connection is established like in mongoose. |
Will this method work when using MongoDB in a replicaset and the URL specifies multiple hosts? I did not see any indication in the code that it does. |
Stumbled across this obviously using Mongoose and unsure of where the expected connect-mongodb db object is. The proposed solution to use the db url, would open 2 connections as far as I can tell. Ideally there'd be a way to get the expected db object out of mongoose and reuse it rather than setting up a separate connection. Will follow-up if I find it. |
@CrabBot I also wanted to use an existing connection rather than creating a separate one and the solution that worked for me was to use
|
@lern Thanks. I'll check that out. |
@lern |
Just a follow-up, @lern's solution works. |
Hi.
I'm using [email protected] and getting "TypeError: Cannot call method 'findOne' of null at MongoStore.get"
after updated to [email protected], [email protected]. I guess your mongodb version 0.9.7 is rather old one.
The text was updated successfully, but these errors were encountered: