diff --git a/.changeset/large-pans-pull.md b/.changeset/large-pans-pull.md new file mode 100644 index 0000000..fd2ceb2 --- /dev/null +++ b/.changeset/large-pans-pull.md @@ -0,0 +1,5 @@ +--- +'@cosmicjs/sdk': patch +--- + +update readme to include concise format for updateOne and deleteOne diff --git a/README.md b/README.md index 5088a87..49309d3 100644 --- a/README.md +++ b/README.md @@ -105,19 +105,12 @@ await cosmic.objects.insertOne({ Use the `objects.updateOne()` method to update an Object by specifying the Object `id` and include properties that you want to update using `$set`. ```jsx -await cosmic.objects.updateOne( - { - id: '5ff75368c2dfa81a91695cec', +await cosmic.objects.updateOne('5ff75368c2dfa81a91695cec', { + content: 'This is the updated blog post content... I got it now!', + metadata: { + featured_post: false, }, - { - $set: { - content: 'This is the updated blog post content... I got it now!', - metadata: { - featured_post: false, - }, - }, - } -); +}); ``` ### Delete Object [[see docs](https://docs-v3.cosmicjs.com/docs/api/objects#delete-an-object)] @@ -125,9 +118,7 @@ await cosmic.objects.updateOne( Use the `objects.deleteOne()` method to delete an Object by specifying the Object `id`. ```jsx -await cosmic.objects.deleteOne({ - id: '5ff75368c2dfa81a91695cec', -}); +await cosmic.objects.deleteOne('5ff75368c2dfa81a91695cec'); ``` ## Learn more