【发布时间】:2021-02-11 16:07:40
【问题描述】:
我有一个文档参考,我正在从对我的 Firestore 数据库的查询中检索该参考。我想使用 DocumentReference 作为另一个查询的查询参数。但是,当我这样做时,它会说
TypeError: sequence item 1: expected str instance, DocumentReference found
这是有道理的,因为我试图在我的更新语句中传递一个 DocumentReference:
db.collection("Teams").document(team).update("Dictionary here") # team is a DocumentReference
有没有办法从DocumentReference 获取文档名称?现在,在您将其标记为重复之前:我尝试查看文档 here 和问题 here,尽管文档非常混乱且问题没有答案。
任何帮助表示赞赏,在此先感谢您!
【问题讨论】:
标签: python firebase google-cloud-firestore