The example code is below:
exports.updateUser = functions.firestore
.document('users/{userId}')
.onUpdate((change, context) => {
// Get an object representing the document
// e.g. {'First Name': 'Marie', 'age': 66}
const newValue = change.after.data();
// ...or the previous value before this update
const previousValue = change.before.data();
// access a particular field as you would any JS property
//const name = newValue.name; //How does one accesses 'FIRST NAME'
// perform desired operations ...
});
If 'FIRST NAME' is replaced by 'name' it is easy, but my data comes from somewhere else where I have no control on the field names. So the field descriptions have spaces between. How do I read them please?