【发布时间】:2019-11-02 16:27:18
【问题描述】:
我正在尝试收听 Firebase 集合以创建文档。
firebase 文档是这样列出的:
# Create a callback on_snapshot function to capture changes
def on_snapshot(col_snapshot, changes, read_time):
print(u'Callback received query snapshot.')
print(u'Current cities in California:')
for doc in col_snapshot:
print(u'{}'.format(doc.id))
col_query = db.collection(u'cities').where(u'state', u'==', u'CA')
# Watch the collection query
query_watch = col_query.on_snapshot(on_snapshot)
有没有什么方法可以引用文档标题,而不是 where() 中的 u'state'? (文档中没有标题)
我尝试过使用u'__name__',但出现错误:
RuntimeError: Error 3: a filter on __name__ must be a document resource name
【问题讨论】:
标签: python firebase google-cloud-firestore