Options
All
  • Public
  • Public/Protected
  • All
Menu

A document belonging to a Collection with an inner value.

Hierarchy

  • Document

Index

Constructors

Accessors

  • get _id(): any
  • Returns the document ID as value.

    Returns any

  • Returns the document path at the root of the document.

    Returns DocumentPath

  • Convenience property, same as calling path.value. The value is cached on first access and returned on subsequent calls without calling path.value again.

    Returns DocumentValue

Methods

  • Convenience method, same as calling path.at().

    Parameters

    • keyPathOrIndex: string | number

    Returns DocumentPath

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

    Parameters

    • documentID: any

    Returns string

  • Returns a hash that represents the passed in document(s).

    Parameters

    Returns BigInt

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

    Parameters

    Returns string

  • 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