ERROR [Better Auth]: mongodb-adapter is not supported. #870

Closed
opened 2026-03-13 08:08:12 -05:00 by GiteaMirror · 8 comments
Owner

Originally created by @imranhc0 on GitHub (Mar 18, 2025).

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

  1. Try to setup with express and mongodb using the example from docs

Image

Current vs. Expected behavior

It should generate the db schema, but it says: ERROR [Better Auth]: mongodb-adapter is not supported.

What version of Better Auth are you using?

1.2.4

Provide environment information

- OS: Windows 10

Which area(s) are affected? (Select all that apply)

Package

Auth config (if applicable)

export const auth = betterAuth({
    database: mongodbAdapter(db)
});

Additional context

No response

Originally created by @imranhc0 on GitHub (Mar 18, 2025). ### Is this suited for github? - [ ] Yes, this is suited for github ### To Reproduce 1. Try to setup with express and mongodb using the example from docs ![Image](https://github.com/user-attachments/assets/369c4ee3-f82d-401b-9b92-a62f03535251) ### Current vs. Expected behavior It should generate the db schema, but it says: ERROR [Better Auth]: mongodb-adapter is not supported. ### What version of Better Auth are you using? 1.2.4 ### Provide environment information ```bash - OS: Windows 10 ``` ### Which area(s) are affected? (Select all that apply) Package ### Auth config (if applicable) ```typescript export const auth = betterAuth({ database: mongodbAdapter(db) }); ``` ### Additional context _No response_
GiteaMirror added the bug label 2026-03-13 08:08:12 -05:00
Author
Owner

@JNLei commented on GitHub (Mar 19, 2025):

I don't think you need to generate the schema if you use mongodb. For me, I simply just provide the mongodb client, and when the first user authenticated, all collections got created and documents were created.
The schema is for relational DB, not for NoSQL.

@JNLei commented on GitHub (Mar 19, 2025): I don't think you need to generate the schema if you use mongodb. For me, I simply just provide the mongodb client, and when the first user authenticated, all collections got created and documents were created. The schema is for relational DB, not for NoSQL.
Author
Owner

@Muhamed-Ragab commented on GitHub (Mar 19, 2025):

It's not working with me too, but you can use Prisma for managing MongoDB

@Muhamed-Ragab commented on GitHub (Mar 19, 2025): It's not working with me too, but you can use Prisma for managing MongoDB
Author
Owner

@imranhc0 commented on GitHub (Mar 19, 2025):

@JNLei could you please explain me how? I mean did you create the user schema on your own? I tried it this way because in their docs they have this command to generate schema.

@imranhc0 commented on GitHub (Mar 19, 2025): @JNLei could you please explain me how? I mean did you create the user schema on your own? I tried it this way because in their docs they have this command to generate schema.
Author
Owner

@JNLei commented on GitHub (Mar 19, 2025):

@JNLei could you please explain me how? I mean did you create the user schema on your own? I tried it this way because in their docs they have this command to generate schema.

No, no schema nor any collection need to be created. When the first user signup ( you can test on your local), all collections will be created.

@JNLei commented on GitHub (Mar 19, 2025): > [@JNLei](https://github.com/JNLei) could you please explain me how? I mean did you create the user schema on your own? I tried it this way because in their docs they have this command to generate schema. No, no schema nor any collection need to be created. When the first user signup ( you can test on your local), all collections will be created.
Author
Owner

@imranhc0 commented on GitHub (Mar 19, 2025):

@JNLei ok understood, what are the endpoints they provide?

@imranhc0 commented on GitHub (Mar 19, 2025): @JNLei ok understood, what are the endpoints they provide?
Author
Owner

@JNLei commented on GitHub (Mar 19, 2025):

@JNLei ok understood, what are the endpoints they provide?

Could you please be more specific about what endpoints are you referring to?

@JNLei commented on GitHub (Mar 19, 2025): > [@JNLei](https://github.com/JNLei) ok understood, what are the endpoints they provide? Could you please be more specific about what endpoints are you referring to?
Author
Owner

@imranhc0 commented on GitHub (Mar 19, 2025):

@JNLei ok understood, what are the endpoints they provide?

Could you please be more specific about what endpoints are you referring to?

I mean, what are the API endpoint they provide in server-side?

@imranhc0 commented on GitHub (Mar 19, 2025): > > [@JNLei](https://github.com/JNLei) ok understood, what are the endpoints they provide? > > Could you please be more specific about what endpoints are you referring to? I mean, what are the API endpoint they provide in server-side?
Author
Owner

@imranhc0 commented on GitHub (Mar 19, 2025):

@JNLei got it, thank you bro

@imranhc0 commented on GitHub (Mar 19, 2025): @JNLei got it, thank you bro
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#870