Option to pass in client instead of clientPromise to MongoDB Adapter #3960
AnishDe12020
started this conversation in
Ideas
Replies: 1 comment
-
This is taken from the recommendations in the Next.js example repository: https://github.com/vercel/next.js/blob/canary/examples/with-mongodb/lib/mongodb.js This should actually hold the connection if you use it in other places compared to what you are suggesting, where the adapter would need to create its own connection. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Title
Option to pass in client instead of clientPromise to MongoDB Adapter
How to reproduce ☕️
Not a bug report.
Your question/bug report 📓
Currently, the MongoDB Adapter takes in a
clientPromise
which is awaited on the adapter and a connection is established. However, if I want to use MongoDB in my application for anything other than auth, I need to open another connection to the database. It would be helpful if we could (or at least had the option to) pass in aMongoClient
object to the adapter.Contributing 🙌🏽
Yes, I am
Beta Was this translation helpful? Give feedback.
All reactions