put method

void put(
  1. K key,
  2. V value
)

Puts value for key in the map, under a tag of its own.

Writing a key that already exists adds a new tag rather than replacing the old one, which is how the key reads back as updated. The tag is the OperationId the document mints for the operation, so two peers writing the same key concurrently converge on the higher stamp.

Implementation

void put(K key, V value) {
  final operation = _ORMapPutOperation<K, V>.fromHandler(
    this,
    key: key,
    value: value,
  );
  doc.registerOperation(operation);
}