Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MutableDocument

A representation of a Document that can be mutated via MutableDocumentPath. You don't create or interact with a MutableDocument direclty but rather through our proxy-based subscripting API exposed within the update() methods of PendingCursorOperation and PendingIDSpecificOperation.

Hierarchy

  • MutableDocument

Index

Properties

Methods

Properties

Readonly _id

Returns the ID of the document.

Readonly _pathAt

_pathAt: (key: string) => MutableDocumentPath

Type declaration

Readonly _value

Returns the content (aka value) of the document. What you actually get is a proxy that you can freely manipulate and Ditto will register the changes, commiting them at the end of an update closure.

Methods

Static id

  • Returns the ID for a mutable document.

    Parameters

    • mutableDocument: any

    Returns DocumentID

Static pathAt

  • Returns a mutable document path object for a given key for a mutable document.

    Parameters

    • mutableDocument: any
    • key: string
    • Optional skipValidation: boolean

    Returns MutableDocumentPath

Static value

  • Returns the content (aka inner value) of a mutable document.

    Parameters

    • mutableDocument: any

    Returns DocumentValue