Skip to content

Commit c403c6b

Browse files
authored
Merge pull request #3290 from ably/liveobjects/rest-api-remove-standalone-objects
Remove standalone objects from REST API usage docs
2 parents 4dfcb74 + 3098aeb commit c403c6b

1 file changed

Lines changed: 5 additions & 61 deletions

File tree

src/pages/docs/liveobjects/rest-api-usage.mdx

Lines changed: 5 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -562,42 +562,6 @@ The newly created object's ID will be the first item in the list:
562562
```
563563
</Code>
564564

565-
### Creating standalone objects <a id="creating-standalone"/>
566-
567-
Create objects without immediately assigning them by omitting both `objectId` and `path` from the create operation.
568-
569-
<Code>
570-
```shell
571-
curl -X POST "https://main.realtime.ably.net/channels/my-channel/object" \
572-
-u {{API_KEY}} \
573-
-H "Content-Type: application/json" \
574-
-d '{
575-
"mapCreate": {
576-
"semantics": 0,
577-
"entries": {
578-
"name": {"data": {"string": "Alice"}}
579-
}
580-
}
581-
}'
582-
```
583-
</Code>
584-
585-
The response includes the generated object ID:
586-
587-
<Code>
588-
```json
589-
{
590-
"messageId": "TJPWHhMTrF:0",
591-
"channel": "my-channel",
592-
"objectIds": ["map:abc123def456...@1745835549101"]
593-
}
594-
```
595-
</Code>
596-
597-
<Aside data-type='important'>
598-
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.
599-
</Aside>
600-
601565
### Client-generated object IDs <a id="client-generated-ids"/>
602566

603567
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:
660624
The server validates that your `objectId` matches the hash of `initialValue + nonce`.
661625
</Aside>
662626

663-
#### Publishing with client-generated IDs <a id="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" \
673-
-u {{API_KEY}} \
674-
-H "Content-Type: application/json" \
675-
-d '{
676-
"objectId": "map:Qj2kkvprTybCY5mkNMcm31hhNKZCDWqcz45LjYvCABs@1769079911168",
677-
"mapCreateWithObjectId": {
678-
"initialValue": "{\"semantics\":0,\"entries\":{\"name\":{\"data\":{\"string\":\"Alice\"}},\"age\":{\"data\":{\"number\":30}}}}",
679-
"nonce": "random-nonce-abc123"
680-
}
681-
}'
682-
```
683-
</Code>
684-
685-
#### Atomic batch with cross-references <a id="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:
688628

689629
<Code>
690630
```shell
@@ -712,6 +652,10 @@ Create a map and immediately assign it to the channel object in a single atomic
712652

713653
Both operations execute atomically. The second operation references the object created in the first because you pre-computed the ID.
714654

655+
<Aside data-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+
715659
<Aside data-type='note'>
716660
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.
717661
</Aside>

0 commit comments

Comments
 (0)