This will overwrite any data at this location and all child locations.
The effect of the write will be visible immediately, and the corresponding
events ("value", "child_added", etc.) will be triggered. Synchronization of
the data to the Firebase servers will also be started, and the returned
Promise will resolve when complete. If provided, the onComplete callback
will be called asynchronously after synchronization has finished.
Passing null for the new value is equivalent to calling remove(); namely,
all data at this location and all child locations will be deleted.
set() will remove any priority stored at this location, so if priority is
meant to be preserved, you need to use setWithPriority() instead.
Note that modifying data with set() will cancel any pending transactions
at that location, so extreme care should be taken if mixing set() and
transaction() to modify the same data.
A single set() will generate a single "value" event at the location where
the set() was performed.
Writes data to this Database location.
This will overwrite any data at this location and all child locations.
The effect of the write will be visible immediately, and the corresponding events ("value", "child_added", etc.) will be triggered. Synchronization of the data to the Firebase servers will also be started, and the returned Promise will resolve when complete. If provided, the
onCompletecallback will be called asynchronously after synchronization has finished.Passing
nullfor the new value is equivalent to callingremove(); namely, all data at this location and all child locations will be deleted.set()will remove any priority stored at this location, so if priority is meant to be preserved, you need to usesetWithPriority()instead.Note that modifying data with
set()will cancel any pending transactions at that location, so extreme care should be taken if mixingset()andtransaction()to modify the same data.A single
set()will generate a single "value" event at the location where theset()was performed.