Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Readonly _id

_id: any

Returns the ID of the document.

Readonly _incrementCounterAt

_incrementCounterAt: (mutableDocument: any, keyPath: string, amount: number, skipValidation?: boolean) => void

Type declaration

    • (mutableDocument: any, keyPath: string, amount: number, skipValidation?: boolean): void
    • Convenience method, equvalent to obtaining a MutableDocumentPath for the passed in keyPath via pathAt() followed by increment() on that.

      Parameters

      • mutableDocument: any
      • keyPath: string
      • amount: number
      • Optional skipValidation: boolean

      Returns void

Readonly _pathAt

_pathAt: (key: string) => MutableDocumentPath

Type declaration

Readonly _replaceWithCounterAt

_replaceWithCounterAt: (mutableDocument: any, keyPath: string, skipValidation?: boolean) => void

Type declaration

    • (mutableDocument: any, keyPath: string, skipValidation?: boolean): void
    • Increments the counter of mutableDocument at the given keyPath.

      Parameters

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

      Returns void

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 the update closure.

Readonly _valueAt

_valueAt: (path: string) => any

Type declaration

    • (path: string): any
    • Returns the content (aka inner value) of a document at the given path. If the value is a dictionary or an array, what you actually get is a proxy that you can freely manipulate and Ditto will register the changes, commiting them at the end of the update closure.

      Parameters

      • path: string

      Returns any

Methods

Static id

  • id(mutableDocument: any): any
  • Returns the ID for a mutable document.

    Parameters

    • mutableDocument: any

    Returns any

Static incrementCounterAt

  • incrementCounterAt(mutableDocument: any, keyPath: string, amount: number, skipValidation?: boolean): void
  • Increments the counter of mutableDocument at the given keyPath.

    Parameters

    • mutableDocument: any
    • keyPath: string
    • amount: number
    • Optional skipValidation: boolean

    Returns void

Static pathAt

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

    Parameters

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

    Returns MutableDocumentPath

Static replaceWithCounterAt

  • replaceWithCounterAt(mutableDocument: any, keyPath: string, skipValidation?: boolean): void
  • Turns the value of mutableDocument at the given keyPath into a counter.

    Parameters

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

    Returns void

Static value

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

    Parameters

    • mutableDocument: any

    Returns DocumentValue

Static valueAt

  • valueAt(mutableDocument: any, path: string): any
  • Returns the content (aka inner value) of a document at the given path.

    Parameters

    • mutableDocument: any
    • path: string

    Returns any