delete
delete
works the same as firestore delete
but with the same syntax as the sweetened get
.
delete doc
await db.delete("users", "bob")
// equivalent firestore
await fb.collection("users").doc("bob").delete()
delete multiple docs with query
await db.delete("users", ["age", ">", 30])
// equivalent firestore
const docs = await fb.collection("users").doc("bob").where("age", ">", 30).get()
let batch = fb.batch()
docs.forEach((ss)=>{
batch.delete(ss._ref)
})
await batch.commit()