Attachments ($meta)
You can store attachments for any entry by writing records into a dedicated system entry:
<parent_entry_name>/$meta
This is useful for schema fragments, calibration metadata, plugin configuration, or any small JSON payload that should travel with the entry.
Attachments are regular records with a few extra rules.
Each attachment is identified by a required key label, which lets you store multiple attachments in the same $meta entry and update/remove them individually.
For example, if your parent entry name is robot/front/camera, the attachments entry is robot/front/camera/$meta.
Attachment keys starting with $ are reserved for internal ReductStore purposes.
Please use keys without a leading $ for user-defined attachments.
Create or Replace an Attachment
Write the attachment content as a normal record body and set the attachment key label.
If a record with the same key already exists in the same $meta entry, ReductStore replaces it automatically.
For write requests:
x-reduct-label-keyis required.- Writing with the same
keyreplaces the previous attachment with thatkey. - Writing with
x-reduct-label-remove: trueis not allowed. Use a label update (PATCH) to remove an attachment.
Attachments can also be created with batch endpoints. The same rules apply: the entry path must end with /$meta, and the key label is required for each attachment record.
Changes:
- Version 1.19: Entry attachments in system
$metaentries were introduced. - Version 1.19: entry names can be hierarchical paths with multiple segments (for example,
a/b/c).
If a $meta record with key=$plugin already exists, it is replaced by this new record.
Read an Attachment
Reading attachments works exactly like reading regular records: use the attachment path and timestamp.
Because $meta is a system entry:
- It is hidden from bucket
entry_countand entry lists. - Wildcard entry-name queries do not include it, so you must address it by its exact path (
<parent_entry_name>/$meta).
If you don't know the timestamp of an attachment, query the $meta entry by key first (see the Query API).
Remove an Attachment
To remove an attachment, update labels of the existing $meta record and set remove=true.
This is intentionally done through PATCH (update), not through a write request.
It is also the recommended way when replication is enabled, because record deletions are not replicated.
The PATCH request must target an existing attachment record timestamp.
Delete $meta Entry Directly
Direct deletion of the system $meta entry is not allowed.
If you need to delete it, remove the parent entry instead. The $meta entry is removed together with its parent.
$meta records are included in bucket size/usage accounting, and $meta is renamed automatically when its parent entry is renamed.
Typical Flow
In practice, attachment handling usually looks like this:
- Write attachment data to
<parent_entry_name>/$metawith akey. - Write a newer record with the same
keywhen you need to update it. - Query
<parent_entry_name>/$metabykeyif you need to find the attachment timestamp. - Read the attachment record when needed.
- Remove it with
PATCHandx-reduct-label-remove: true.