SocialluxSociallux
Toggle navigation menu
Docs navigationv

Primitive

atom.updateDataFields

BETA

Short name: updateDataFields

Version: 1.0.0

System primitive that writes a bag of top-level atom.data fields by delegating each key to atom.findOrCreateDataField. This is a sequential loop and not a single-document atomic update across all keys.

Back to primitive library

Inputs

KeyTypeRequiredDescription
atomIdobjectIdtrueAtom whose data fields should be updated.
dataobjecttrueObject map whose keys are top-level data field names and whose values are the values to write.
expectedVersionintegerfalseOptional optimistic concurrency guard. When provided, the atom version must match before writing any fields.
protectedKeysarrayfalseOptional list of field keys that are rejected when present in data.
valueTypesobjectfalseOptional fieldName to AtomFieldInputType map. Unspecified keys use delegated default behavior.

Outputs

KeyTypeRequiredDescription
atomobjectfalseUpdated atom summary: { id, version } after the final write.
skippedKeysarrayfalseField keys whose input value was undefined and therefore skipped.
writtenKeysarrayfalseField keys that were written.