Google cloud platform &引用;未找到匹配的索引";通过数据存储库使用Google Cloud Firestore时

Google cloud platform &引用;未找到匹配的索引";通过数据存储库使用Google Cloud Firestore时,google-cloud-platform,google-cloud-firestore,google-cloud-datastore,Google Cloud Platform,Google Cloud Firestore,Google Cloud Datastore,我有一个在Firestore模式下配置数据存储的Google云平台项目,其中以下(Python)代码生成Google.api\u core.exceptions.failedPremission:400未找到匹配索引。错误 from google.cloud import datastore store = datastore.Client(project='my-project') query = store.query(kind='my-kind') query.add_filter('s

我有一个在Firestore模式下配置数据存储的Google云平台项目,其中以下(Python)代码生成
Google.api\u core.exceptions.failedPremission:400未找到匹配索引。
错误

from google.cloud import datastore

store = datastore.Client(project='my-project')
query = store.query(kind='my-kind')
query.add_filter('start_date', '<', 1500000000)
results = query.fetch()
for r in results:  # error thrown here
    print(r)
从google.cloud导入数据存储
store=datastore.Client(project='my-project')
query=store.query(kind='my-kind')

query.add\u过滤器('start_date','不幸的是,Firestore本机和数据存储模式下的Firestore之间的索引不同。您需要使用匹配的客户端使查询正常工作。我建议您使用python库而不是google cloud数据存储库。

正如Jim Morrison所指出的,您需要使用Firestore库

从google.cloud导入firestore
db=firestore.Client()
#[开始获取简单查询]
docs=db.collection(u'my-collection')。其中(u'start_date',u'{}'。格式(doc.id,doc.to_dict())