Skip to content
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

db.admin is not a function #17

Open
joaoritter opened this issue Jun 17, 2018 · 4 comments · May be fixed by #18
Open

db.admin is not a function #17

joaoritter opened this issue Jun 17, 2018 · 4 comments · May be fixed by #18

Comments

@joaoritter
Copy link

joaoritter commented Jun 17, 2018

image

image

image

I'm using Mongoose 5.1.5 and pm2 2.10.4

@aesmon
Copy link

aesmon commented Sep 30, 2018

Same error. Mongo 3.6.5 and pm2 2.10.4

@s-a s-a linked a pull request Oct 24, 2018 that will close this issue
@esellier
Copy link

The correct init function should be (nodejs mongo client lib v3.5) :
var url = 'mongodb://' + login + host + ':' + port; MongoClient.connect(url, function(err, connection) { if (err) return done(err); client = connection.db(dbName||"admin").admin(); done(); });

@OliMations
Copy link

This is still a problem on MongoDB 4.2.11 and PM2 4.2.3

@nsinfoPRO
Copy link

Any progress on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants