【问题标题】:Firebase function not deleting documentFirebase 功能不删除文档
【发布时间】:2019-07-11 04:34:38
【问题描述】:

Firebase 函数已成功执行,但未删除文档。没有错误。 ID 以正确的方式传递。

exports.toremove = functions.firestore
  .document('school/toremove')
  .onUpdate((change, context) => {
    const newValue = change.after.data();

    const id = newValue.id;
    console.log("DELETING THE DOC with id= " + id)
    return admin.firestore().collection('notifications').doc(id).delete();
  });

【问题讨论】:

标签: javascript firebase google-cloud-firestore google-cloud-functions


【解决方案1】:

使用 PHP 中的 unlink() 函数。 参考https://www.php.net/manual/en/function.unlink.php

【讨论】:

  • 这不是 php。这是用于 firebase 函数的 javascript
猜你喜欢
  • 1970-01-01
  • 2020-09-28
  • 2020-03-28
  • 1970-01-01
  • 1970-01-01
  • 2021-08-22
  • 1970-01-01
  • 2019-01-04
  • 1970-01-01
相关资源
最近更新 更多