| am_get | R Documentation |
Retrieves a value from an Automerge map or list. Returns NULL
if the key or index doesn't exist.
am_get(doc, obj, key)
doc |
An Automerge document |
obj |
An Automerge object ID (from nested object), or |
key |
For maps: character string key. For lists: numeric index
(1-based). Returns |
The value at the specified key/position, or NULL if not found.
Nested objects are returned as am_object instances.
doc <- am_create()
am_put(doc, AM_ROOT, "name", "Alice")
name <- am_get(doc, AM_ROOT, "name")
name # "Alice"
am_close(doc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.