How to connect with custom MongoDB collections? #1456
Unanswered
jahirfiquitiva
asked this question in
Help
Replies: 1 comment 1 reply
-
I'm fairly new to this library myself so take this with a grain of salt. I'm currently migrating users from my previous structure to this structure so I had to modify the schema to account for that. I would fork the library (make your own copy of it) & then modify the models to work accordingly. You can see the models for the adapters here. Once done, look where it is being called & update the callers so that you pass the relevant data to the models. Take a look at the adapters as they are in charge of creating the users here. There is an example adapter here. Hope that guides you a bit |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hello... from what I've understood from documentation,
next-auth
will automatically generate collections for users and other stuff.In my database, I already have a users collection, and the schema is something like:
Since
next-auth
won't provide all of these, how can I create users with this custom model, with the data retrieved withnext-auth
.I mean, I'm ok with some fields being empty. But would like
next-auth
to create users in this collection with this specific model, but also keep the other collections created bynext-auth
just as they are.I'd really appreciate any guidance and/or help on how to achieve this.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions