From dc86179130475088f6f42d0fda9328b4ab97f031 Mon Sep 17 00:00:00 2001 From: Nikolas Date: Thu, 23 Nov 2023 09:58:36 +0100 Subject: [PATCH] Update 07-mongodb.mdx (#5489) --- content/200-concepts/200-database-connectors/07-mongodb.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/200-concepts/200-database-connectors/07-mongodb.mdx b/content/200-concepts/200-database-connectors/07-mongodb.mdx index 6ccecc7254..0188af6dc3 100644 --- a/content/200-concepts/200-database-connectors/07-mongodb.mdx +++ b/content/200-concepts/200-database-connectors/07-mongodb.mdx @@ -107,6 +107,8 @@ Any field (most commonly IDs and relation scalar fields) that maps to an `Object - Must include the `@db.ObjectId` attribute - Can optionally use `@default(auto())` to auto-generate a valid `ObjectId` on document creation +Here is an example that uses `String`: + ```prisma model User { id String @id @default(auto()) @map("_id") @db.ObjectId @@ -114,6 +116,8 @@ model User { } ``` +And here is another example that uses `Bytes`: + ```prisma model User { id Bytes @id @default(auto()) @map("_id") @db.ObjectId