DataService class used for initialize the SDK

Hierarchy

  • DataService

Constructors

  • Creates an instance of DataService.

    Memberof

    DataService

    Parameters

    • Optional app: FirebaseApp

      instance of firebase app

    Returns DataService

Properties

appRef: FirebaseApp
collectionName?: string
collectionRef?: CollectionReference<DocumentData, DocumentData>
db: Firestore

Methods

  • This method used to keep the instance of the collection.

    Parameters

    • collectionName: string

      string

    Returns DataService

  • This method used to returns the DocumentData stored in the firestores's collection.

    Returns

    Promise<QuerySnapshot>

    Parameters

    • Optional queryConstraints: QueryConstraint[]

      array ( list of where clauses )

    Returns Promise<QuerySnapshot<DocumentData, DocumentData>>

  • Parameters

    • docId: string

    Returns Promise<DocumentSnapshot<DocumentData, DocumentData>>

  • This method used to delete all the document from the firebase collection.

    Returns

    Promise

    Returns Promise<any>

  • This method used to delete the document from the firebase collection.

    Returns

    Promise

    Parameters

    • docId: string

      string

    Returns Promise<void>

  • This method used to add the document to the firebase collection.

    Returns

    Promise

    Parameters

    • docData: {}

      object

      Returns Promise<DocumentReference<DocumentData, DocumentData>>

    • This method used to add the document to the firebase collection with a sepcific ID.

      Returns

      Promise

      Parameters

      • docId: string

        string

      • docData: {}

        object

        Returns Promise<void>

      • This method used to keep the instance of the sub collection.

        Parameters

        • parentDocId: string
        • subCollectionName: string

          string

        Returns DataService

      • This method used to update/change the document data in the firebase collection.

        Returns

        Promise

        Parameters

        • docId: string

          string

        • data: {}

          object

          Returns Promise<any>

        Generated using TypeDoc