【问题标题】:Is the not equals cloud firestore query functionality available for flutter plugin? [closed]不等于 Cloud Firestore 查询功能是否可用于 Flutter 插件? [关闭]
【发布时间】:2020-10-17 18:36:13
【问题描述】:

因此,在本月初,firebase 团队宣布 here 现在可以使用 equals 查询,但我无法找到这是否也可以在颤振中使用。如果是,请提供语法吗?

谢谢。

【问题讨论】:

    标签: flutter google-cloud-firestore


    【解决方案1】:

    2020 年 11 月 6 日更新:

    cloud_firestore 0.14.3 现在支持 != 使用 isNotEqualTo 的查询,如where() 的 API 文档中所示。如果您使用的是旧版本,则必须升级。

    原答案:

    Flutter 目前不支持 Firestore 的不等式查询。如果是,您会在API documentation for the where method 中看到它。它还需要更新query limitations 上的书面文档,目前它说:

    Cloud Firestore 不支持以下类型的查询:

    带有 != 子句的查询。在这种情况下,您应该将查询拆分为大于查询和小于查询。例如,不支持查询子句 where("age", isNotEqualTo: 30),但是您可以通过组合两个查询得到相同的结果集,一个带有 where("age", isLessThan: 30) 子句,一个带有子句 where("age", isGreaterThan: 30)

    跟踪此更新的 GitHub 问题在这里:https://github.com/FirebaseExtended/flutterfire/pull/3748

    自 11 月 4 日起,更新已合并,并应出现在 release notes 中描述的未来版本中。

    【讨论】:

    猜你喜欢
    • 2020-10-31
    • 2020-10-15
    • 1970-01-01
    • 2021-03-26
    • 1970-01-01
    • 1970-01-01
    • 2018-03-16
    • 2020-01-16
    • 2020-08-18
    相关资源
    最近更新 更多