Fix for merge option while setting value

This commit is contained in:
Kunal Kamble
2020-07-28 03:09:36 -04:00
parent af3f99f139
commit 98e01d2d90
2 changed files with 3 additions and 2 deletions

View File

@ -14,7 +14,8 @@ module.exports = function(RED) {
if(msg && msg.payload){
console.log('firestore-set got input')
console.dir(msg)
const {path, obj, merge} = msg.payload
const {path, obj} = msg.payload
const merge = (msg.payload.merge == undefined) ? false : msg.payload.merge
console.log('storing '+obj+' at firestore path '+path)
this.admin.firestore().doc(path).set(obj, { merge }).then((res)=>{
console.log('firestore set result '+res)