ozzyonfire / shopify-next-app

Shopify app template on Next.js with app directory
https://shopify-next-app-six.vercel.app
MIT License
72 stars 10 forks source link

MongoDB connection not working #13

Open AghaShayan123 opened 1 month ago

AghaShayan123 commented 1 month ago

Hi, I have updated schema.prisma file with below code to connect with MongoDB but still not working

datasource db { provider = "mongodb" // other supported providers are: postgresql, mysql, sqlite, sqlserver, mongodb url = env("DATABASE_URL") directUrl = env("DIRECT_DATABASE_URL") }

Getting below error

Screenshot 2024-10-18 at 3 46 27 PM
huykon commented 3 weeks ago

@AghaShayan123 your error look like you using mongodb local and maybe it hasn't enabled. I also using the mongodb local but facing with other error:

code: 'P2023', clientVersion: '5.10.2', meta: { modelName: 'Session', message: 'Malformed ObjectID: provided hex string representation must be exactly 12 bytes, instead got: "mason- check.myshopify.com_80855007369", length 37.' }

ozzyonfire commented 3 weeks ago

You also need to restart your nextjs server if you make any changes to prisma.