You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pages/docs/liveobjects/rest-api-usage.mdx
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -556,6 +556,26 @@ The following example creates a new `LiveMap` instance and assigns it to the `po
556
556
```
557
557
</Code>
558
558
559
+
The following example shows how to update a key and value in a `LiveMap`:
560
+
561
+
<Code>
562
+
```shell
563
+
curl -X POST "https://main.realtime.ably.net/channels/my-channel/object" \
564
+
-u {{API_KEY}} \
565
+
-H "Content-Type: application/json" \
566
+
-d '{
567
+
"operation": "MAP_SET",
568
+
"path": "posts.post1",
569
+
"data": {
570
+
"key" : "title",
571
+
"value": {"string": "LiveObjects is still awesome"}
572
+
}
573
+
}'
574
+
```
575
+
</Code>
576
+
577
+
Note in this example if the key `title` didn't exist it would have been created and set by this operation.
578
+
559
579
When using the `path` specifier with a `COUNTER_CREATE` or `MAP_CREATE` operation, the server constructs *two* operations which are published as a [batch](#batch-operations):
560
580
561
581
* A `MAP_CREATE` or `COUNTER_CREATE` operation used to create the new object
0 commit comments