2

I'm building create, update and delete operations in my app that uses Firebase. Regarding this answer on a question about the difference between set() and update(), @jmk2142 suggested that creating, updating and deleting an item in firebase could all be done with update().

Apart from semantics / understanding the purpose of the code, is there any good reason NOT to use update() for all of these?

Frank van Puffelen
  • 499,950
  • 69
  • 739
  • 734
Sventies
  • 1,752
  • 1
  • 20
  • 40

1 Answers1

8

If you want to replace the entire value in a location, you'll want to use set().

If you want to update specific properties or paths under a location, use update().

Frank van Puffelen
  • 499,950
  • 69
  • 739
  • 734