Function getDoc

  • This function gets a document from the database by its ID.

    const doc = await getDoc(collection, "10")
    const id = doc.id
    const content = doc.doc

    Type Parameters

    Parameters

    • col: Collection

      the instance of collection

    • id: string

      the id of document

    Returns Promise<DocumentEntry<T>>

    the DocumentEntry if the document was found. Otherwise, raises an error.

Generated using TypeDoc