From 842b1ca05615c869faf0f3be1fbbbcb09c7074da Mon Sep 17 00:00:00 2001 From: Trent Holliday Date: Wed, 25 Sep 2024 14:33:30 -0400 Subject: [PATCH] Update CRUD.md modifying database example Updated the example showing how to use database.write to include a proper implementation of the `.update` method where the record to modify comes from the arg in the update callback. --- docs-website/docs/docs/CRUD.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs-website/docs/docs/CRUD.md b/docs-website/docs/docs/CRUD.md index 9e167684d..fc443f211 100644 --- a/docs-website/docs/docs/CRUD.md +++ b/docs-website/docs/docs/CRUD.md @@ -42,8 +42,8 @@ All modifications to the database (like creating, updating, deleting records) mu ```js await database.write(async () => { - const comment = await database.get('comments').find(commentId) - await comment.update(() => { + const someComment = await database.get('comments').find(commentId) + await someComment.update((comment) => { comment.isSpam = true }) })