Skip to main content
An ORSet (Observed-Remove Set) allows concurrent adds and removes without conflicts. Each add generates a unique tag; a remove only removes the specific tags it observed — so a concurrent add of the same element wins.

Usage without schema

Usage with schema

Incoming deltas are validated against the schema at runtime via Schema.decodeUnknownSync. Invalid entries are discarded.

Encryption

ORSet supports end-to-end encryption. Pass an encryption map to MeridianClient.create():
The SDK uses deterministic nonce derivation (nonce = SHA-256(plaintext)[0:12]) so that the same element always produces the same ciphertext. This is required for correctness: the server keys entries by encrypted value, and remove() must reconstruct the exact same key. See Encryption for the full security analysis.

Element depth limit

ORSet elements must be scalars or single-level objects/arrays (depth ≤ 1). Nested structures are rejected by the server:
Rejected ops return a 400 error with the message ORSet element nesting depth X exceeds maximum 1. This limit is enforced at the server level and cannot be bypassed.

API