gpt4 book ai didi

javascript - 根据自定义字段更新 Firebase 文档

转载 作者:行者123 更新时间:2023-11-30 10:59:13 24 4
gpt4 key购买 nike

<分区>

我得到了以下 Firebase 文档:

{
"customField1": "customValue1",
"customField2": "customValue2",
"fieldToChange: "valueToChange"
}

我想知道如何进行两个操作:

  1. 找到将“customField1”设置为“customValue1”的文档并将“valueToChange”更新为其他内容。

  2. 找到“customField1”设置为“customValue1”且“customField2”设置为“customValue2”的文档,并将“valueToChange”更新为其他内容。

我怎样才能做到这一点?

我只看到需要 docId 的选项:

const uploadCollection = this.db.collection<any>('uploads');
return await uploadCollection.doc(docId).update({ 'fieldToChange': 'another value' });

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com