Skip to content

Commit

Permalink
Update 07-mongodb.mdx (#5489)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolasburk authored Nov 23, 2023
1 parent 0b2e22e commit dc86179
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions content/200-concepts/200-database-connectors/07-mongodb.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,17 @@ 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
// Other fields
}
```

And here is another example that uses `Bytes`:

```prisma
model User {
id Bytes @id @default(auto()) @map("_id") @db.ObjectId
Expand Down

1 comment on commit dc86179

@vercel
Copy link

@vercel vercel bot commented on dc86179 Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./

docs-git-main-prisma.vercel.app
docs-prisma.vercel.app
prisma2-docs.vercel.app

Please sign in to comment.