I’ve been figuring out how to get the key and use it but couldn’t figure it out. Tried Object.keys, nothing good was on YT for it, Get Firebase child nodes' names without getting their children too in Firebase response?, Firebase REST API working with shallow data, using .getKey to get the key and store it to then use .update after receiving it etc. I’m probably overthinking it, thanks in advance.
firebase
.database()
.ref("Posts")
.push({
Title: textToSaveTitle,
Post: textToSave,
uid: user.uid,
profilePic: downloadURL,
firstLast: fln,
username: username,
likes:0,
//flair:
document.getElementById("dropdownMenuButton").innerHTML,
time: time + " " + cMonth + "/" + cDay + "/" + cYear
}).getKey()
.then(function () {
console.log(key);
firebase
.database()
.ref("Posts")
.on("value", function (lists) {
lists.forEach(function (data) {
var info = data.val();
var keys = Object.keys(lists)
console.log(keys)