对于文档 {userID},我想创建一个名为“notfications”的子集合并将数据设置为它。如何访问文档和设置数据?
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
exports.updateUser = functions.firestore
.document('users/{userID}/reports/{reportID}')
.onUpdate((change, context) => {
// Get an object representing the document
// e.g. {'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 st1 = newValue.status;
const st2 = previousValue.status;
console.log('I am a log entry!' + st1 + " " + st2);
// …Run Code Online (Sandbox Code Playgroud) node.js firebase google-cloud-functions google-cloud-firestore
如何使用本机驱动程序更改本教程代码中的高度、宽度和边距?
https://www.youtube.com/watch?v=yQK2oaIN0yA&list=PLy9JCsy2u97k6olfalMTA_XSPz4pNuT46&index=9