Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 141247

I can not increment firestore field value [closed]

$
0
0

This is the approach I am using to increment the field values of my firestore given document field, But it's not incrementing instead it's just resetting the values which I am sending as parameters in increment() function.

import * as firebase from "firebase/app";

\\\\\

this.afs
        .collection("orders")
        .doc(this.finalDate)
        .update({
          profit: firebase.firestore.FieldValue.increment(orderProfit),
          itemCount: firebase.firestore.FieldValue.increment(itemCount)
        });

How can I fix this?

This is the structure of my firestore collection/document


Viewing all articles
Browse latest Browse all 141247

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>