FieldValue undefined when using functions and Firestore

前端 未结 2 1826
别那么骄傲
别那么骄傲 2020-12-15 03:56

I have the following function:

const functions = require(\'firebase-functions\');
const admin = require(\'firebase-admin\');
const FieldValue = require(\'fir         


        
2条回答
  •  有刺的猬
    2020-12-15 04:05

    It worked!

    Require firebase-admin

    const admin = require('firebase-admin')
    

    Add this constant

    const fieldValue = admin.firestore.FieldValue; 
    

    Now use

    fieldValue.delete()
    

    For more reference : otcollect.com/post

提交回复
热议问题