I wrote a cloud functions to get the triggered document data . But I am getting [object object]
My code is :
exports.accept = functions.firestore
.document('deyaPayUsers/{aID}/Split/{aID1}/ReceivedInvitation/{autoIds}')
.onWrite(event=>{
const db1 = admin.firestore();
const MAuth = event.params.aID;
console.log("mauthid"+MAuth);
const MAuth1 = event.params.aID1;
const resautoid = event.params.autoIds;
console.log("resss"+resautoid);
var document = event.data.data();//not getting data
console.log("newvalue is :"+document);it prints [object object]
});
How to get the data using cloud functions from FireStore triggers.