繁体   English   中英

Firebase 函数部署:错误 3 - 请求有错误

[英]Firebase Functions Deploy: Error 3 - The Request has errors

我正在尝试使用 2 个wildcards

functions.firestore
    .document('establishments/{establishmentId}/payment/payments/{paymentId}')

并得到

“错误 3:请求有错误”。

但是,当仅使用 1 时,该功能正常工作:

functions.firestore
    .document('establishments/{establishmentId}')

完整的功能代码:

exports.myFunction = functions.firestore
    .document('establishments/{establishmentId}/payment/payments/{paymentId}')
    .onUpdate((change, context) => {
        return secondaryApp.firestore()
            .collection("myCollection").doc("myDocument")
            .update(change.after.data());
    })

--debug日志:

[2021 - 07 - 13T16: 35: 32.864Z] << < HTTP RESPONSE BODY { "error": { "code":400, "message": "请求有错误", "status": "INVALID_ARGUMENT", "详细信息”:[{“@type”:“type.googleapis.com/google.rpc.BadRequest”,“fieldViolations”:[{“field”:“event_trigger”,“description”:“预期值机构/{establishmentId} /payment/payments/{paymentId} 匹配正则表达式 [^/]+/[^/]+(/[^/]+/[^/]+)*" }] }] } } ⚠ 功能:未能更新函数项目/myProject/locations/us - central1/functions/myFunction

消防店:

 - establishments: collection
   - {establishmentId}: document
     - payment: map
       - payments: array
         - {paymentId}: map

确认路径以文档结尾,并且它遵循模式collection/document/collection/document/...我猜路径应该是'establishments/{establishmentId}/payments/{paymentId}'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM