Prisma MongoDB
Hello everyone. I want to using Prisma with MongoDB, NestJS. I was setup with docs, and when start server, I have an error with Typescript:
this is my version of prisma:
"prisma": "6.2.1",
"@prisma/client": "6.2.1",
And my mongoDB is local MongoDB, not replicate. But I not using transaction on my code
This is my schema:
yarn start
[9:51:57 AM] Starting compilation in watch mode...
node_modules/@prisma/client/runtime/library.d.ts:1444:35 - error TS1005: '?' expected.
1444 select: infer S extends object;
~
node_modules/@prisma/client/runtime/library.d.ts:1446:36 - error TS1005: '?' expected.
1446 include: infer I extends object;
~
[9:52:02 AM] Found 2 errors. Watching for file changesyarn start
[9:51:57 AM] Starting compilation in watch mode...
node_modules/@prisma/client/runtime/library.d.ts:1444:35 - error TS1005: '?' expected.
1444 select: infer S extends object;
~
node_modules/@prisma/client/runtime/library.d.ts:1446:36 - error TS1005: '?' expected.
1446 include: infer I extends object;
~
[9:52:02 AM] Found 2 errors. Watching for file changesthis is my version of prisma:
"prisma": "6.2.1",
"@prisma/client": "6.2.1",
And my mongoDB is local MongoDB, not replicate. But I not using transaction on my code
This is my schema:
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
model Document {
id String @id @default(auto()) @map("_id") @db.ObjectId
name String
description String?
code String @unique
fileUrl String?
partnerUrl String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("Document")
}// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
model Document {
id String @id @default(auto()) @map("_id") @db.ObjectId
name String
description String?
code String @unique
fileUrl String?
partnerUrl String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("Document")
}