Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DocumentRef<T>

Representation of a Document Reference

Type parameters

  • T: Entity

    The entity for the document reference.

Hierarchy

  • DocumentRef

Implements

Index

Constructors

constructor

  • Create a document reference using a document ID, entity and parent collection.

    Parameters

    • id: string

      The document ID.

    • model: object

      The entity class for the document.

    • parent: ICollection<T>

      The parent collection.

    Returns DocumentRef

Properties

Private _cachedDocument

_cachedDocument: T | null

Private _id

_id: string

Private _model

_model: object

Type declaration

Private _native

_native: DocumentReference

Private _parent

_parent: ICollection<T>

Private _path

_path: string

Accessors

cached

  • get cached(): T | null

id

  • get id(): string

native

  • get native(): DocumentReference

parent

path

  • get path(): string

Methods

Private buildNative

  • buildNative(): DocumentReference

Private buildPath

  • buildPath(): string

Private buildSnapshot

collection

  • collection<C>(collectionModel: object): ICollection<C>

get

  • get(): Promise<T>

isFetched

  • isFetched(): boolean

onSnapshot

  • onSnapshot(onNext: function, onError?: undefined | function): function
  • Attaches a listener for snapshot events for the document

    Parameters

    • onNext: function

      Callback which is called when a new snapshot is available.

    • Optional onError: undefined | function

      Callback which is called when listen fails.

    Returns function

    The unsubscribe function for the listener.

      • (): void
      • Returns void

Generated using TypeDoc