Firestore Sweet

Firestore Sweet

  • Tutorial
  • API
  • Github

›Write

Tutorial

  • Getting Started

Read

  • get
  • on
  • ref

Write

  • add
  • set
  • upsert
  • update
  • delete

FieldValue

  • inc
  • del
  • ts
  • union
  • remove

Atomic & Bulk

  • tx
  • batch

set

set works the same as firestore set but with the same syntax as the sweetened get .

add doc with specified id

await db.set({name: "Bob", age: 30}, "users", "bob")
// equivalent firestore
await fb.collection("users").doc("bob").set({name: "Bob", age: 30})

reset multiple docs with query

await db.set({name: "John", age: 30}, "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.set(ss._ref, {name: "John", age: 30})
})
await batch.commit()
← addupsert →
  • add doc with specified id
  • reset multiple docs with query
Firestore Sweet
Docs
Getting StartedAPI Reference
Who's Using Firesotre Sweet ?
WARASHIBEALISCHOOLcrypvoVePress
Where to Find Me ?
ALIS BlogGitHubStar
Follow @ocrybit
Copyright © 2020 Tomoya Nagasawa