MongoStore.create({}) options 'client' and 'clientPromise' not compatible with Mongoose version 6
See original GitHub issue-
I’m submitting a … [x] bug report [ ] feature request [ ] question about the decisions made in the repository [ ] question about how to use this project
-
Summary Mongoose has been updated to version 6. When using
client
orclientPromise
inMongoStore.create({ })
, sessions are no longer saved to database. -
Other information (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top Results From Across the Web
MongoStore: Cannot Init Client. Not accepting mongoose ...
Turns out the mongooseConnection parameter to the MongoStore constructor ... the getClient() function to help make that happen - like this:
Read more >Mongoose v6.8.1: Connecting to MongoDB
You can connect to MongoDB with the mongoose.connect() method. ... you should also disable the autoCreate option and use createCollection() to create capped ......
Read more >Connect-mongo NPM | npm.io
Create a new connection from a MongoDB connection string · Re-use an existing native MongoDB driver client promise.
Read more >I'm trying to connect mongoDB to my web app but it shows ...
A snippet of code showing how you are creating the connection including your MongoDB connection string with any password or hostname details ...
Read more >Day 45: PassportJS + Express + MongoDB? - Jamal J8 Ahmed
The connect-mongo packages has some cryptography options so maybe there is ... that must be provided for the Mongostore.create() methods.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This example demonstrates how it’s done with Mongoose 6 https://github.com/jdesboeufs/connect-mongo/blob/master/example/mongoose.js . Though I prefer a bit simpler approach (one that’s also closer to what was there with previous versions):
this works for me
=================Main Code=============================
================= End Main Code=============================