5

So, I know there are a few similarly named questions, but this is not the same. I am curious to see if anyone could explain the reasoning for the lack of an increment sentinel, similar to the delete one.

As far as I know, a field deletion is no different than a document update. Meaning, I can just delete my field by simply updating the entire document to some new data, leaving that field out, hence, the question.

If we have a FieldValue.delete(), why the lack of a FieldValue.increment()

Note: I am aware of the 1QPS limit and I doubt it has anything to do with the above.

Regards!

Eduard
  • 3,395
  • 8
  • 37
  • 62

1 Answers1

5

Version 5.9.0 - Mar 14, 2019

Added FieldValue.increment(), which can be used in update() and set(..., {merge:true}) to increment or decrement numeric field values safely without transactions.

https://firebase.google.com/support/release-notes/js

Henry
  • 32,689
  • 19
  • 120
  • 221