1.0.0 • Published 8 months ago

firestore-util v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Firestore Util

The Firestore tool functions.

Installation

npm install firestore-util

Usage

  const firestoreUtil = require('firestore-util')


  // Trigger a function when a new user is created
  firestoreUtil.triggers.v1.onCreateOnce('/users/{userId}', async (snapshot, context) => {
    const { userId } = context.params
    const username = snapshot.data().name
  })

Functions

triggers

Firestore Cloud FunctionsSupport version
onCreateOncev1, v2
onUpdateOncev1, v2
onDeleteOncev1, v2
onWriteOncev1, v2

db

OperationsDescription
setnxCreate document with the provided object values if document does not exist.
timeoutSets a time limit on an firestore method.

License

This repository is licensed under the MIT license. The license can be found here.