firebase set method on node success listner code example
Example 1: firebase update data
await firebase.database().ref().update(updates);
Example 2: write firebase data using variables javascript
foo = {};
foo[variable] = 'more stuff';
fb.set(foo);