Skip to main content

mr resources add-meta

Add metadata keys to every Resource listed in --ids by passing a JSON string via --meta. The given keys are merged over the existing meta and own_meta: a key of the same name is overwritten, keys not named are left alone. A blank --meta is a no-op, the JSON is validated first, and the call fails if any ID in --ids does not exist. For single-resource single-key edits, use resource edit-meta (dot-path syntax).

Usage

mr resources add-meta

Examples

Set a single key on multiple resources

mr resources add-meta --ids 1,2,3 --meta '{"status":"reviewed"}'

Set multiple keys at once (JSON object)

mr resources add-meta --ids 1,2 --meta '{"priority":5,"owner":"alice"}'

Flags

FlagTypeDefaultDescription
--idsstring``Comma-separated resource IDs (required) (required)
--metastring``Meta JSON string (required) (required)

Inherited global flags

FlagTypeDefaultDescription
--jsonboolfalseOutput raw JSON
--no-headerboolfalseOmit table headers
--pageint1Page number for list commands (default page size: 50)
--quietboolfalseOnly output IDs
--serverstringhttp://localhost:8181mahresources server URL (env: MAHRESOURCES_URL)

Exit Codes

0 on success; 1 on any error

See Also