Firebase firestore cloud functions showing Error: Invalid use of type “undefined” as a Firestore argument

后端 未结 3 444
独厮守ぢ
独厮守ぢ 2021-01-07 17:05

I have a project to add currency details into the firestore database and my project is doing with ionic 3

Whenever I add a new document to the collection a trigger f

3条回答
  •  花落未央
    2021-01-07 17:37

    The error message is this:

    Invalid use of type "undefined" as a Firestore argument.
    

    You can see in your stack trace that this happens when you call set() with an object on a DocumentReference. It turns out that one of the values you're passing in the object is undefined. Check each of the values that you're passing and make sure all of them have an actual value:

     .set({
       id : id,
       branchName : branchName,
       currencyName : currencyName,
       sellingRate : sellingRate,
       buyingRate :buyingRate
      });
    

    It's impossible to tell which one it is from the error message, so you'll have to print them all out do something to check each and every one of them.

提交回复
热议问题