Firebase Cloud Function 调用了错误的集合,即使它引用了另一条路径
Firebase Cloud Function is calling the wrong collection even though it is referencing another path
exports.requestPayment = functions.firestore.document('/Orders/{documentId}').onCreate((change, context) => {
console.log(change.ref);
return;
});
打印出来:
...
"_path": {
"segments": [
"Payments",
"Cm4rXRPnWnOpZNryWRN4"
],
...
}
该函数打印出错误的集合和文档。
原来我需要在 Google Cloud Functions 的实际设置中更改 documentPath。当您按编辑时,您可以更改路径。
exports.requestPayment = functions.firestore.document('/Orders/{documentId}').onCreate((change, context) => {
console.log(change.ref);
return;
});
打印出来:
...
"_path": {
"segments": [
"Payments",
"Cm4rXRPnWnOpZNryWRN4"
],
...
}
该函数打印出错误的集合和文档。
原来我需要在 Google Cloud Functions 的实际设置中更改 documentPath。当您按编辑时,您可以更改路径。