我想做
let start = new Date ('2018-08-01');
let end = new Date ('2018-08-31');
let ref = db.collection ('events'). where ("dt_inicio", ">", start) .where ("dt_fim", "<", end);
错误:
Invalid query. All where filters with an inequality (<, <=, >, or >=) must be on the same field. But you have inequality filters on 'dt_inicio' and 'dt_fim'
但是我得到以下链接中的错误: https://cloud.google.com/appengine/docs/standard/go/datastore/query-restrictions
有什么办法可以解决这个问题?
答案 0 :(得分:0)
Cloud Firestore只能对一个字段进行范围过滤,而不能对多个字段进行范围过滤。这样做的原因是(为了达到Firestore的正常水平),为了达到性能保证,Firestore必须能够在单个流中返回所有结果,而只能向前移动其索引。
我还推荐了视频系列Getting started with Cloud Firestore,其中介绍了Firestore的功能,局限性和推理。