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
Standalone objects are not reachable until assigned to the object tree. Unreachable objects are eligible for garbage collection. See [Object reachability and garbage collection](#object-reachability) for details.
Generate [object IDs](/docs/liveobjects/concepts/objects#object-ids) when creating objects to enable atomic batch operations with cross-references between newly created objects. This is useful when creating multiple objects that reference each other in a single batch.
@@ -660,31 +624,7 @@ There are additional operations for creating objects with client-generated IDs:
660
624
The server validates that your `objectId` matches the hash of `initialValue + nonce`.
661
625
</Aside>
662
626
663
-
#### Publishing with client-generated IDs <aid="creating-with-client-ids"/>
664
-
665
-
Publish an operation using either `mapCreateWithObjectId` or `counterCreateWithObjectId` to create
666
-
an object with a client-generated ID.
667
-
668
-
For example:
669
-
670
-
<Code>
671
-
```shell
672
-
curl -X POST "https://main.realtime.ably.net/channels/my-channel/object" \
#### Atomic batch with cross-references <aid="atomic-batch-cross-references"/>
686
-
687
-
Create a map and immediately assign it to the channel object in a single atomic operation:
627
+
The following example creates a new `LiveMap` instance with a pre-computed object ID using the `mapCreateWithObjectId` operation, and immediately assigns it to the channel object in a single atomic batch:
688
628
689
629
<Code>
690
630
```shell
@@ -712,6 +652,10 @@ Create a map and immediately assign it to the channel object in a single atomic
712
652
713
653
Both operations execute atomically. The second operation references the object created in the first because you pre-computed the ID.
714
654
655
+
<Asidedata-type='important'>
656
+
Objects created with client-generated IDs should be assigned to the object tree as part of the same batch operation. Objects that are not assigned are immediately unreachable and subject to [garbage collection](#object-reachability).
657
+
</Aside>
658
+
715
659
<Asidedata-type='note'>
716
660
Only use client-generated IDs when you need atomic batch operations with cross-references. For most use cases, use simple operations or path-based operations instead.
0 commit comments