using update firebas 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);
await firebase.database().ref().update(updates);
foo = {};
foo[variable] = 'more stuff';
fb.set(foo);