MongoDB E11000 Duplicate "id" Key Error
I've been encountering this issue since I'm using Discord's OAUTH2 with BetterAuth while using MongoDB as an adapter.
The exact error is as shown:
I've tried setting
What could be the issue?
The exact error is as shown:
I've tried setting
generateId to false like:What could be the issue?
Solution
it could be that there are already fields in that webusers table with the
id field & it's unique constraint, so even after you updated the mongoose schema it doesn't reflect mongo