Skip to content

Commit

Permalink
Merge pull request #12 from cosmicjs/tony/readme
Browse files Browse the repository at this point in the history
Tony/readme
  • Loading branch information
tonyspiro authored Mar 27, 2023
2 parents dfcd621 + 2aea85b commit 0c8fd1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/large-pans-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cosmicjs/sdk': patch
---

update readme to include concise format for updateOne and deleteOne
21 changes: 6 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,29 +105,20 @@ 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)]

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
Expand Down

0 comments on commit 0c8fd1f

Please sign in to comment.