Google cloud firestore Google FireStore-移动计划或资源预订-如何查询

Google cloud firestore Google FireStore-移动计划或资源预订-如何查询,google-cloud-firestore,Google Cloud Firestore,我需要检查资源是否在特定时间内可用。要知道,我需要查询以下6个字段 startdate-大于运算符 enddate-小于运算符 开始时间-大于运算符 endtime-les than运算符 isactive-相等运算符 资源列表-数组包含 db.collection(entitytype).document(entityid).collection(u'SHIFTPLAN')。其中(“isactive”、“=”,True)。其中(“startdate”、“>=”,2222)。其中(“e

我需要检查资源是否在特定时间内可用。要知道,我需要查询以下6个字段

  • startdate-大于运算符

  • enddate-小于运算符

  • 开始时间-大于运算符

  • endtime-les than运算符

  • isactive-相等运算符

  • 资源列表-数组包含


    db.collection(entitytype).document(entityid).collection(u'SHIFTPLAN')。其中(“isactive”、“=”,True)。其中(“startdate”、“>=”,2222)。其中(“enddate”、“=”,333)。其中(“endtime”,"这是NoSQL结构的一个常见限制,尤其是firestore-您正在牺牲一些性能以获得巨大的可扩展性。您必须将获取的记录/文档数量降至最低,但仍必须在浏览器/客户端上进行一些筛选。在startdate上使用查询可能是最大的%因素,然后,您只需获取以下内容:

    db.collection(entitytype).document(entityid).collection(u'SHIFTPLAN').where("isactive","==",True).where("startdate",">=",22222222)where("daysofweek","array_contains","ab").stream()
    
    并在本地执行其余的过滤器