I have a really simple Firestore app. Besides the setting up with firebase.initializeApp(firebaseConfig);
, it's only this:
db.collection("users").add({
username: username
})
.then((docRef) => {
console.log("Document written with ID: ", docRef.id);
})
.catch((error) => {
console.error("Error adding document: ", error);
});
Yet when I run this application with node index.js
, it writes Document written with ID: XYZ
and then it takes an additional minute to end and give control back to the terminal. I might not be using the precise terms here, so a correction would be appreciated as well.
Is there a reason for this? Should I be terminating the connection or something?