am_keys: Get all keys from an Automerge map

View source: R/objects.R

am_keysR Documentation

Get all keys from an Automerge map

Description

Returns a character vector of all keys in a map.

Usage

am_keys(doc, obj)

Arguments

doc

An Automerge document

obj

An Automerge object ID (must be a map), or AM_ROOT for the document root

Value

Character vector of keys (empty if map is empty)

Examples

doc <- am_create()

am_put(doc, AM_ROOT, "a", 1)
am_put(doc, AM_ROOT, "b", 2)

keys <- am_keys(doc, AM_ROOT)
keys  # c("a", "b")

am_close(doc)


automerge documentation built on Feb. 5, 2026, 5:08 p.m.