Options
All
  • Public
  • Public/Protected
  • All
Menu

A document belonging to a Collection with an inner value.

Hierarchy

  • Document

Index

Properties

Readonly _id

_id: any

Returns the ID of the document.

Readonly _pathAt

_pathAt: (key: string) => DocumentPath

Type declaration

Readonly _value

Returns the content (aka value) of the document.

Readonly _valueAt

_valueAt: (path: string) => any

Type declaration

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

      Parameters

      • path: string

      Returns any

Methods

Static base64StringForID

  • base64StringForID(documentID: any): string
  • Returns a byte representation of the document ID value as base64 string.

    Parameters

    • documentID: any

    Returns string

Static hash

  • hash(documentOrMany: any): BigInt
  • Returns a hash that represents the passed in document(s).

    Parameters

    • documentOrMany: any

    Returns BigInt

Static hashMnemonic

  • hashMnemonic(documentOrMany: any): string
  • Returns a pattern of words that together create a mnemonic, which represents the passed in document(s).

    Parameters

    • documentOrMany: any

    Returns string

Static id

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

    Parameters

    • document: any

    Returns any

Static pathAt

  • pathAt(document: any, keyPath: string, skipValidation?: boolean): DocumentPath
  • Returns a document path object for a given key for a document.

    Parameters

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

    Returns DocumentPath

Static stringForID

  • stringForID(documentID: any): string
  • Returns a string representation of the passed in document ID value.

    The returned string can be used directly in queries that you use with other Ditto functions. For example you could create a query that was like this:

    collection.find(`_id == ${Document.stringForID(documentID)}`)
    

    Parameters

    • documentID: any

    Returns string

Static value

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

    Parameters

    • document: any

    Returns DocumentValue

Static valueAt

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

    Parameters

    • document: any
    • path: string

    Returns any