Closed dopla-dev closed 11 months ago
Hi, hope you are well, the same problem here https://prnt.sc/0wE_0QclIszC are you able to solve this ?
Hi, hope you are well, the same problem here
are you able to solve this ?
I just found this, I haven't implemented it yet but looks like a good workaround:
https://github.com/Shopify/shopify-app-template-remix/issues/285
Issue summary
I'm attempting to use MongoDB Atlas as the db to handle session storage via Prisma. But I'm struggling with an apparent conflict between the way that 'id' is handled in the prisma model / @shopify/shopify-app-session-storage-prisma.
When using MongoDB, Prisma requires the id to @map("_id"). From the Prisma docs:
"The MongoDB connector has specific rules for defining an ID field that differs from relational databases. An ID must be defined by a single field using the @id attribute and must include @map("_id")."
However, this causes a conflict when attempting to store a session in the table, because the id (e.g. offline_dopla-dev.myshopify.com) is not a field that should be upserted (and I think also because it is not an objectId).
"@shopify/app": "3.50.2", "@shopify/shopify-app-session-storage-prisma": "^2.0.0"