Options
All
  • Public
  • Public/Protected
  • All
Menu

A document belonging to a Collection with an inner value.

Hierarchy

  • Document

Index

Properties

_id: any

Returns the ID of the document.

_pathAt: (key: string) => DocumentPath

Type declaration

Returns the content (aka value) of the document.

_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

  • Support for JSON-stringifying a document directly.

    Returns DocumentValue

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

    Parameters

    • documentID: any

    Returns string

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

    Parameters

    • documentOrMany: any

    Returns BigInt

  • 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

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

    Parameters

    • document: any

    Returns any

  • 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

  • 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

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

    Parameters

    • document: any

    Returns DocumentValue

  • 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