Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DocHandle<T>

Type parameters

  • T

Hierarchy

  • DocHandle

Index

Properties

Methods

Properties

db

db: Database

docID

docID: string

path

path: object

If a document field's ValidationSchema has a SpecFunction, path[key] offers a function to acquire a @PathHandle to all associated documents for the document field's key. Example:

const root = DS.useRoot(db, PostSpec);

const repliesHandle = await root
  .then(_ => _.create())
  .then(_ => _.path.reply())

Type declaration

spec

spec: SpecFunction<T>

Methods

mutate

  • mutate(mutator: function): Promise<void>
  • mutate(mutator) will update the handling document given some content transformation function.

    Parameters

    • mutator: function
        • (content?: Partial<T>): Partial<T> | void
        • Parameters

          • Optional content: Partial<T>

          Returns Partial<T> | void

    Returns Promise<void>

resolve

  • resolve(): Promise<Doc<T>>
  • resolve() will read the handling document out from the pouchDB database handle.

    Returns Promise<Doc<T>>

Generated using TypeDoc