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

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})
← setupdate →
  • add doc or update if doc already exists
Firestore Sweet
Docs
Getting StartedAPI Reference
Who's Using Firesotre Sweet ?
WARASHIBEALISCHOOLcrypvoVePress
Where to Find Me ?
ALIS BlogGitHubStar
Follow @ocrybit
Copyright © 2020 Tomoya Nagasawa