upsert
upsert
is the same as firestore set
with {merge: true}
but with the same syntax as the sweetened get
.
add doc or update if doc already exists
await db.upsert({name: "Bob", age: 30}, "users", "bob")
// equivalent firestore
await fb.collection("users").doc("bob").set({name: "Bob", age: 30}, {merge: true})