0

Setting the value of a key to nil results in that key value pair being deleted from the system. In a certain context, I need to update one key with a legit value, and delete a different key value pair. I need a guarantee for either both of these transactions to run, or neither of them to run, hence the necessity to use update value. However I have a problem, update value takes a dictionary, and as we all know setting a dictionary's key to nil results in that key value pair being absent from the dictionary (contrary to what firebase's docs allude to). So how can I accomplish my goal?

ref.updateChildValues([path1 : realValue, path2 : nil])

The above code results in value at path1 being updated, but value at path2 is never deleted. Any help is greatly appreciated!

n00bie42
  • 163
  • 7

0 Answers0