Learn R Programming

automerge (version 0.4.0)

am_list_get_all: Get all conflicting values at a list position

Description

Returns all values stored at a list position, including conflicts from concurrent edits. When there are no conflicts, the list contains a single element (the winning value).

Usage

am_list_get_all(doc, obj, pos, heads = NULL)

Value

A list of all values at the position. Returns an empty list if the position does not exist.

Arguments

doc

An Automerge document

obj

An Automerge object ID (must be a list)

pos

Numeric index (1-based, like R vectors)

heads

Optional list of change hashes (raw vectors) for historical query. If NULL (default), uses the current state.

Examples

Run this code
doc <- am_create()
doc$items <- list("a", "b", "c")
items <- doc$items

# Single value (no conflict)
values <- am_list_get_all(doc, items, 1)
values

am_close(doc)

Run the code above in your browser using DataLab