【问题标题】:GQL query with multiple condition on one List field在一个列表字段上具有多个条件的 GQL 查询
【发布时间】:2010-11-26 08:27:26
【问题描述】:

我想获取对象,其中列表字段包含“foo”、“bar”和“foobar”字符串。我可以这样查询吗

SELECT * FROM Entity WHERE listfield = 'foo' AND listfield = 'bar' AND listfiled = 'foobar'

其中 listfield = StringListProperty() ?

【问题讨论】:

    标签: google-app-engine google-cloud-datastore gql gqlquery


    【解决方案1】:

    有一点需要注意,确保您的 index.yaml 文件包含您需要的所有索引排列。您的上述查询将具有如下索引:

    • 种类:实体 特性:
      • 名称:xyz
      • 名称:列表字段
      • 名称:列表字段
      • 名称:列表字段

    【讨论】:

      【解决方案2】:

      是的,你可以这样做。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-07-26
        相关资源
        最近更新 更多