-
Notifications
You must be signed in to change notification settings - Fork 341
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
Mongoose connection #397
Comments
{
// Consider this block scope, `connection` is not promise in here and show does `client`
const { connection } = await mongoose.connect(`mongodb://mongo:${dbPort}/${dbName}`, {
useUnifiedTopology: true,
useNewUrlParser: true,
useCreateIndex: true
});
const client = connection.getClient()
}
// if this block scope is inside an async function and what you get will be a promise |
I'm not sure I understand what you are getting at. This is the official example:
The only reason the My point: |
Is there an issue with You can just as easily Because of |
Created 4.3.0 release: https://github.com/jdesboeufs/connect-mongo/blob/master/CHANGELOG.md#430---2021-03-08 |
I have an issue using Mongoose connection as shown in the provided example. I connect to MongoDB this way:
When creating the session store, this doesn't work, because
getClient
doesn't return Promise but connect-mongo expects one:clientPromise: connection.getClient()
Therefore, I have to do this:
clientPromise: Promise.resolve(connection.getClient())
.The text was updated successfully, but these errors were encountered: