Skip to main content

mr groups add-meta

Merge a Meta JSON object onto multiple Groups at once. Both arguments are required: --ids selects the target Groups (comma-separated) and --meta is a JSON object string that is merged onto each target's existing Meta. Top-level keys named in --meta replace the stored value; keys not named are preserved.

How nested objects merge depends on the database. PostgreSQL replaces a nested object wholesale, while SQLite merges into it recursively and removes any key whose value is null. Pass whole top-level values when the two must agree.

To edit a single path on a single group, prefer group edit-meta which takes a dotted path + JSON literal. This bulk variant is best for stamping the same set of keys across many Groups.

Usage

mr groups add-meta

Examples

Stamp one Meta key across three groups

mr groups add-meta --ids 10,11,12 --meta '{"reviewed":true}'

Merge multiple keys

mr groups add-meta --ids 10 --meta '{"season":"winter","owner":"alice"}'

Flags

FlagTypeDefaultDescription
--idsstring``Comma-separated group 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)

Output

Status object with ok (bool)

Exit Codes

0 on success; 1 on any error

See Also