skip to Main Content

I’ve read the docs for upgrading the Cloud functions to version 2 here. But I also need to upgrade the FireStore API (Inside the cloud functions), and no docs there (that I could find).

import { onCall } from 'firebase-functions/v2/https'; // new version 2 - OK
import { firestore, initializeApp } from 'firebase-admin'; // Old version - need to upgrade

Stack : NodeJs 18 cloud functions, "firebase-admin": "^11.8.0","firebase-functions": ^4.3.1"

2

Answers


  1. Chosen as BEST ANSWER

    Ok so the docs were here, inside the FireStore section.

    This is the new FireStore API:

    import { onCall } from 'firebase-functions/v2/https';
    import { firestore, initializeApp } from 'firebase-admin'; // Old version - need to upgrade
    import { initializeApp } from 'firebase-admin/app'; // new version v2
    import { getFirestore } from 'firebase-admin/firestore'; // new version v2
    

  2. To upgrade the Firebase Firestore API version within a Firebase Cloud Function, several steps should be considered:

    Understand the Versioning Scheme:

    Semantic Versioning (SemVer) serves as a standardized approach to versioning software, aimed at offering lucidity and uniformity in comprehending the ramifications of updates. Below is a detailed elucidation of each element:

    you want to learn deep for firebase please go this website ,
    [ https://www.pievcore.com/questions/6478 ]
    download this application [ https://play.google.com/store/apps/details?id=com.piestforum.piforum ]
    this will be helpfull for you.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search