We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am trying to list all databases useing mongodb and mongoose. with mongodb it successesed, but with mogoose I got an error.
mongoose.connect(uri).then( connection=>{ let Admin = mongoose.mongo.Admin; let admin = new Admin(connection.db); console.log({ admin }); //s: { db: undefined, topology: undefined, promiseLibrary: undefined } console.log({ dbs: admin.listDatabases() }); })
but I got the following error:
Cannot read property 's' of undefined
I'm using the last version of mongoose.
The text was updated successfully, but these errors were encountered:
solved by using:
let admin = new Admin(connection.connections[0].db);
Sorry, something went wrong.
After trying the above method, I am getting a different error now -
return (0, execute_operation_1.executeOperation)(this.s.db.client, new list_databases_1.ListDatabasesOperation(this.s.db, options)); ^ TypeError: Cannot read properties of undefined (reading 'client')
listDatabases()
refactor(connection): move listDatabases implementation to node-mongo…
2d4b8c2
…db-native driver Re: #14506 Re: #9048
No branches or pull requests
I am trying to list all databases useing mongodb and mongoose.
with mongodb it successesed, but with mogoose I got an error.
but I got the following error:
I'm using the last version of mongoose.
The text was updated successfully, but these errors were encountered: