[Prisma][MongoDB][Lucia] Malformed objectID
Hi, Im getting very frustrated with the issue Im getting. I was running google oauth on SQLite, but just remapped into MongoDB. I dont know if its Lucia or Prisma... But Im getting this error:
And this is my schema:
Anyone has idea how to fix this issue? 🙂 Tried many things, but nothing worked so far.
2 Replies
Hey 👋
How did you generate this value "t6d6pgyzluujpbeawuees2f6e6j66el62n43fmd3"?
The error message is because it's not in the format that MongoDB expects.
it seems like the schema is generating it:
with , but then it expects and it throws the error.
I fixed the issue by doing this:
so Im using uuid() and String - not native MongoDB ObjectID, and it works...
Perhaps maybe theres some bug with Prisma somewhere for MongoDB? The User that had the ObjectID was correctly created, but the Session is failing on the ObjectIDs - might be due to userId being reference to ObjectId and have two IDs in one schema?
but then, Im using Lucia:
So Im not sure if its Prisma's id or Lucia's tbh
But I did some debuging around, and for me it looks like Prisma, but its my first time doing those stuff so not sure