Skip to main content

set_metadata Command

The set_metadata command sets one or more properties as metadata for incoming database objects.

The metadata state of each node in the database is merged with this new metadata state, so that existing metadata state not defined in this command is not touched.

This command assumes that all incoming elements are either objects coming from a query or are object ids. All objects coming from a query will have a property id. This command will return the updated state.

Usage

set_metadata <properties>

Parameters

ParameterDescriptionRequired?Default Value
propertiesSpace-delimited list of property-value pairs (<name>=<value>)✔️

Examples

> query is(instance) limit 1 | set_metadata a=b b="c" num=2 | list /id, /metadata
​id=123, a=b, b=c, num=2
> json ["id1", "id2"] | set_metadata a=b | list /id /metadata
​id=id1, a=b
​id=id2, a=b