Prisma config with Mongodb

1-Install the Prisma CLI: 2-Initialize a Prisma project: 3-Set the DATABASE_URL in the .env file:Open the .env file and set the DATABASE_URL environment variable to the connection string for your MongoDB database. 4-Generate the Prisma Client:

1-Install the Prisma CLI:

npm i -D prisma

2-Initialize a Prisma project:

npx prisma init --datasource-provider mongodb

3-Set the DATABASE_URL in the .env file:
Open the .env file and set the DATABASE_URL environment variable to the connection string for your MongoDB database.

4-Generate the Prisma Client:

npx prisma generate
model User {
  id String @id @map("_id") @default(auto()) @db.ObjectId
  email String @unique
  password String
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt

}


npx prisma db push   
npx prisma studio
Next Code

react icons not working with remix-run?

You have to addย serverDependenciesToBundleย insid ...

Leave a Reply

Your email address will not be published. Required fields are marked *

top
× How can I help you?