Operation types
Each object type supports specific operations that modify the object’s data.LiveMap operations
LiveMap supports the following operations:set: Set a value for a keyremove: Remove a key and its value
LiveMap instance can be a primitive type or a reference to another object.
LiveCounter operations
LiveCounter supports the following operations:increment: Increment the counter by a specified amountdecrement: Decrement the counter by a specified amount
Create operations
Create operations are used to instantiate new objects of a given type. UseLiveMap.create() and LiveCounter.create() to create new objects. These methods create special value types that can be assigned directly to paths:
Object IDs
Every operation is expressed relative to a specific object instance, identified by its object ID, which determines which object the operation is applied to. When using aPathObject, the specific object instance at the given path is evaluated at the time a method is called that updates the object. The client library will then publish an operation targeting the resolved object.
When using a client library object IDs are handled automatically, allowing you work directly with object references:
Batch operations
Batch operations can be used to batch a set of operations together:- Multiple operations are grouped into a single atomic unit
- All operations in the batch either succeed together or fail together
- Operations in a batch are sent as a single message
- No operations from other clients can be interleaved within a batch
Object message properties
Each operation is carried by anObjectMessage, which is surfaced in subscriptions and provides metadata about the operation and who performed it.
ObjectMessage
The following are the properties of anObjectMessage:
ObjectOperation
Theoperation field of an ObjectMessage contains an ObjectOperation with the following properties:
ObjectData
Thedata field in mapOp is an ObjectData object that represents the value assigned to a map key. It has the following properties:
