You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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"
The text was updated successfully, but these errors were encountered: