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
Update LiveObjects docs for protocol v6 ObjectOperation fields
The ably-js SDK now exposes per-action fields (mapCreate, mapSet,
mapRemove, counterCreate, counterInc, objectDelete) instead of the
combined mapOp/counterOp/map/counter properties. ObjectData also
exposes typed fields (boolean, bytes, number, string, json) instead
of a combined value field. See ably-js PR [1]
Resolves AIT-511
[1] ably/ably-js#2159
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: src/pages/docs/liveobjects/concepts/operations.mdx
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -331,18 +331,24 @@ The `operation` field of an `ObjectMessage` contains an `ObjectOperation` with t
331
331
|----------|-------------|
332
332
|**action**| The operation action. One of: `'map.create'`, `'map.set'`, `'map.remove'`, `'counter.create'`, `'counter.inc'`, or `'object.delete'`|
333
333
|**objectId**| The ID of the object the operation was applied to |
334
-
|**mapOp**| Present for map mutation operations (`'map.set'`, `'map.remove'`). Contains `key` (the key that was modified) and optionally `data` (an `ObjectData` representing the value assigned to the key, present only for `'map.set'` operations) |
335
-
|**counterOp**| Present for counter increment operations (`'counter.inc'`). Contains `amount` (the value added to the counter) |
336
-
|**map**| Present for `'map.create'` operations. Defines the initial value of the map object with optional `semantics` (conflict-resolution strategy) and `entries` (initial key-value pairs) |
337
-
|**counter**| Present for `'counter.create'` operations. Defines the initial value of the counter object with optional `count` (initial counter value) |
334
+
|**mapCreate**| Present for `'map.create'` operations. Defines the initial value of the map object with `semantics` (conflict-resolution strategy) and `entries` (initial key-value pairs) |
335
+
|**mapSet**| Present for `'map.set'` operations. Contains `key` (the key that was set) and `value` (an `ObjectData` representing the value assigned to the key) |
336
+
|**mapRemove**| Present for `'map.remove'` operations. Contains `key` (the key that was removed) |
337
+
|**counterCreate**| Present for `'counter.create'` operations. Defines the initial value of the counter object with `count` (initial counter value) |
338
+
|**counterInc**| Present for `'counter.inc'` operations. Contains `number` (the value added to the counter) |
339
+
|**objectDelete**| Present for `'object.delete'` operations. Empty object with no operation-specific data |
338
340
339
341
#### ObjectData
340
342
341
-
The `data` field in `mapOp` is an `ObjectData` object that represents the value assigned to a map key. It has the following properties:
343
+
The `value` field in `mapSet` is an `ObjectData` object that represents the value assigned to a map key. Exactly one property is set, indicating the type of data:
342
344
343
345
| Property | Description |
344
346
|----------|-------------|
345
-
|**objectId**| A reference to another object (such as a `LiveMap` or `LiveCounter`) by its object ID. Present when the value is a LiveObject |
346
-
|**value**| A decoded primitive value (string, number, boolean, JSON-serializable object or array, or binary data). Present when the value is a primitive type |
347
+
|**objectId**| A reference to another object (such as a `LiveMap` or `LiveCounter`) by its object ID |
348
+
|**boolean**| A boolean leaf value |
349
+
|**bytes**| A binary leaf value (`ArrayBuffer` in browser environments, or `Buffer` in Node.js) |
350
+
|**number**| A numeric leaf value |
351
+
|**string**| A string leaf value |
352
+
|**json**| A parsed JSON object or array leaf value |
0 commit comments