Represents a mutable CRDT Replicated Growable Array (RGA) that can be mutated as part of updating a document.

This class can't be instantiated directly, it's returned automatically for any rga property of a document within an update block via rga.

Hierarchy

  • RGA

    Hierarchy

    • MutableRGA

Accessors

Methods

Accessors

  • get value(): any[]
  • Returns the value of the RGA.

    Returns any[]

Methods

  • Inserts a value into the RGA at the index specified.

    Only valid within the update closure of PendingCursorOperation.update() and PendingIDSpecificOperation.update(), otherwise an exception is thrown.

    Parameters

    • value: any

      The value to insert into the RGA.

    • index: number

      The index at which to insert the provided value.

      @deprecated: RGA usage should be replaced. Use arrays inside Registers instead.

    Returns void

  • Pop a value off the end of the RGA.

    Only valid within the update closure of PendingCursorOperation.update() and PendingIDSpecificOperation.update(), otherwise an exception is thrown.

    Returns

    The value popped off from the end of the RGA.

    @deprecated: RGA usage should be replaced. Use arrays inside Registers instead.

    Returns any

  • Push a value on to the end of the RGA.

    Only valid within the update closure of PendingCursorOperation.update() and PendingIDSpecificOperation.update(), otherwise an exception is thrown.

    Parameters

    • value: any

      The value to push on to the RGA.

      @deprecated: RGA usage should be replaced. Use arrays inside Registers instead.

    Returns void

  • Remove a value at the specified index.

    Only valid within the update closure of PendingCursorOperation.update() and PendingIDSpecificOperation.update(), otherwise an exception is thrown.

    Parameters

    • index: number

      The index of the element to remove.

      @deprecated: RGA usage should be replaced. Use arrays inside Registers instead.

    Returns void

  • Set a value at the specified index.

    Only valid within the update closure of PendingCursorOperation.update() and PendingIDSpecificOperation.update(), otherwise an exception is thrown.

    Parameters

    • value: any

      The value to set at the specified index.

    • index: number

      The index at which to set the provided value.

      @deprecated: RGA usage should be replaced. Use arrays inside Registers instead.

    Returns void