Options
All
  • Public
  • Public/Protected
  • All
Menu

Database Instance

Hierarchy

  • Database

Index

Constructors

constructor

  • new Database(__namedParameters: { auth: undefined | Auth; host: String; name: string; projectId: string; ssl: boolean }): Database
  • Parameters

    • __namedParameters: { auth: undefined | Auth; host: String; name: string; projectId: string; ssl: boolean }
      • auth: undefined | Auth
      • host: String
      • name: string
      • projectId: string
      • ssl: boolean

    Returns Database

Properties

Optional auth

auth: Auth

endpoint

endpoint: string

name

name: string

rootPath

rootPath: string

Methods

batchGet

  • batchGet(refs: Array<Reference | string>): Promise<any>

ref

  • Returns a reference to a document or a collection.

    Parameters

    • path: string | Document

      Path to the collection or document.

    Returns Reference

    instance of a reference.

runTransaction

  • runTransaction(fn: UpdateFunction, attempts?: number): Promise<void>
  • Executes the given updateFunction and attempts to commit the changes applied within it as a Transaction. If any document read within the transaction has changed, Cloud Firestore retries the updateFunction. If it fails to commit after 5 attempts, the transaction fails and throws.

    Will not re-attempt if an error is thrown inside the updateFunction or if any error that is not related to the transaction is received like a network error etc.

    Parameters

    Returns Promise<void>

transaction

Legend

Generated using TypeDoc