the parent factory
returns a reference to a counter object
returns a reference to a fat_counter object
returns a reference to an disable-wins flag object
returns a reference to an enable-wins flag object
returns a reference to a grow-only map
returns a reference to a multi-value register
reads the current value of the object
returns a reference to a last-writer-wins register
Creates an operation to remove an entry from the map. Use Connection.update to send the update to the database.
Creates an operation to remove several entries from the map. Use Connection.update to send the update to the database.
returns a reference to a remove-resets map
returns a reference to an add-wins set object
returns a reference to a remove-wins set object
Generated using TypeDoc
A map with embedded CRDTs. Each map implements the CrdtFactory interface, so it can be used like a connection to create references to embedded objects. The remove and removeAll methods can be used to remove entries from the map.
Example:
let map = connection.map("my-map2"); await connection.update([ map.register("a").set("x"), map.register("b").set("x"), map.register("c").set("x"), map.register("d").set("x"), map.set("e").addAll([1, 2, 3, 4]), map.counter("f").increment(5) ]) await connection.update([ map.remove(map.register("a")), map.removeAll([map.register("b"), map.register("c")]) ]) let val = await map.read(); // convert CrdtMapValue to JavaScript object: let obj = val.toJsObject(); // obj is now { d: "x", e: [1, 2, 3, 4], f: 5 }