add a property to a created object (Firebase Functions)
问题 I'm hooking to the creation of objects on a specific collection (orders) I need to add a new property to the object before it's saved, not returning anything, to no avail. I have looked at the documentation at https://firebase.google.com/docs/reference/functions/functions.firestore.DocumentBuilder#writing_data but it's for onUpdate so it doesn't work as i intend it. exports.createOrder = firestore.document('orders/{orderId}').onCreate((snap, context) => { const newOrder = snap.data() console