我知道这个问题听起来可能很傻,但是如何使用Firebase管理SDK(cloudfirestore)和Python正确地查询数据呢?在
是的,我读过这里的文件:
我的数据库:
我的代码:
existing_post = db.collection(u'posts').where(u'id', u'==', u'BpzIbkqAkk0').get()
print(existing_post)
我还尝试省略.get()方法,但每次都得到相同的结果。在
我得到的只是
^{pr2}$
有什么想法吗?在
Tags:
@Gerardo的评论让我找到了正确的方向。工作代码如下:
必须使用
to_dict()
将生成器对象转换为字典格式。 然后你就可以很容易地访问你想要的任何值。在试试这个可能对你有帮助。在
相关问题 更多 >
编程相关推荐