Skip to content

Commit

Permalink
Merge pull request #424 from Brendonovich/Brendonovich-patch-1
Browse files Browse the repository at this point in the history
Update create.mdx
  • Loading branch information
Brendonovich committed Jan 1, 2024
2 parents ad188e5 + 5987ea8 commit a643eff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions docs/pages/writing-data/create.mdx
Expand Up @@ -81,7 +81,7 @@ let comment: comment::Data = client
.comment()
.create(
"content".to_string(),
// If post wasn't required, then the equals() would need
// If post wasn't required, then this would need
// to be wrapped in comment::post::connect(..).
post::id::equals("id".to_string())
vec![]
Expand All @@ -107,9 +107,9 @@ use prisma::{comment, post};

let comment: comment::Data = client
.comment()
.create(
.create_unchecked(
"content".to_string(),
// requires specifying field for postID,
// requires providing value for postID foreign key,
// rather than connecting a relation
0,
vec![]
Expand Down
3 changes: 2 additions & 1 deletion docs/pages/writing-data/update.md
Expand Up @@ -60,8 +60,9 @@ use prisma::{comment, post};

let comment: comment::Data = client
.comment()
.update(
.update_unchecked(
comment::id::equals("some comment id".to_string()),
// can't `connect` relations, but can set foreign keys directly
vec![comment::post_id::set("some post id".to_string())]
)
.exec()
Expand Down

1 comment on commit a643eff

@vercel
Copy link

@vercel vercel bot commented on a643eff Jan 1, 2024

Choose a reason for hiding this comment

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

Please sign in to comment.