Python 查找具有空字符串的字段

Python 查找具有空字符串的字段,python,google-cloud-firestore,Python,Google Cloud Firestore,我正在尝试查找带有空字符串的字段。它们看起来像这样: Python代码: from loguru import logger from google.cloud import firestore firestore_client = firestore.Client.from_service_account_json('creds.json') ref = firestore_client.collection('database') users_ref = ref.collection(u

我正在尝试查找带有空字符串的字段。它们看起来像这样:

Python代码:

from loguru import logger
from google.cloud import firestore

firestore_client = firestore.Client.from_service_account_json('creds.json')
ref = firestore_client.collection('database')
users_ref = ref.collection(u'users').where(u'placeName', u'==', u'')
docs = [snapshot for snapshot in users_ref.stream()]


我的代码不起作用。如何获取这些字段?

您可以使用如下条件语句:

if(<string> == ""):
    statement
如果(=”):
陈述

这将在这些空字符串中执行您想要执行的语句

您能提供更多信息吗?用户的类型是什么\u ref.stream()?这是一份目录吗?请具体说明“不工作”是什么意思。请参阅,并提供一个。