Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CrdtSet<T>

A set of elements. Elements can be added and removed.

Example:

let set = setType.create<string>("my-set")
await connection.update(
    set.addAll(["a", "b", "c", "d", "e"])
)
await connection.update([
    set.remove("a"),
    set.removeAll(["b", "c"])
])
let val = await set.read();
// val is now ["d", "e"]

Type parameters

  • T

    the type of the elements stored in the set

Hierarchy

Implemented by

Index

Properties

Methods

Properties

parent

parent: CrdtFactory

the parent factory

Methods

add

  • add(elem: T): ApbUpdateOp
  • Creates an operation, which adds an element to the set. Use Connection.update to send the update to the database.

    Parameters

    • elem: T

    Returns ApbUpdateOp

addAll

  • addAll(elems: T[]): ApbUpdateOp
  • Creates an operation, which adds several elements to the set. Use Connection.update to send the update to the database.

    Parameters

    • elems: T[]

    Returns ApbUpdateOp

read

  • read(): Promise<T[]>

remove

  • remove(elem: T): ApbUpdateOp
  • Creates an operation, which removes an element from the set. Use Connection.update to send the update to the database.

    Parameters

    • elem: T

    Returns ApbUpdateOp

removeAll

  • removeAll(elems: T[]): ApbUpdateOp
  • Creates an operation, which removes several elements from the set. Use Connection.update to send the update to the database.

    Parameters

    • elems: T[]

    Returns ApbUpdateOp

Generated using TypeDoc