Learn R Programming

automerge (version 0.3.0)

am_delete_path: Delete value at path

Description

Delete a value from an Automerge document using a path vector.

Usage

am_delete_path(doc, path)

Value

The document (invisibly)

Arguments

doc

An Automerge document

path

Character vector, numeric vector, or list of mixed types specifying the path to the value to delete

Examples

Run this code
doc <- am_create()
am_put_path(doc, c("user", "address", "city"), "NYC")
am_put_path(doc, c("user", "name"), "Alice")

# Delete nested key
am_delete_path(doc, c("user", "address"))

# Address should be gone
am_get_path(doc, c("user", "address"))  # NULL

am_close(doc)

Run the code above in your browser using DataLab