In Google DataStore GQL, how can I group the WHERE terms?

后端 未结 1 928
醉梦人生
醉梦人生 2021-01-26 06:09

I need to group terms in the WHERE clause. For example,

WHERE (param1=\'foo1\' OR param1=\'foo2\') AND (param2=\'bar1\' OR param2=\'bar2\')

Bu

1条回答
  •  伪装坚强ぢ
    2021-01-26 06:45

    I believe the problem you're facing comes from the OR operator - GQL doesn't have one, so the conditions you have in the paranthesis are syntactically incorrect.

    From the WHERE row in the Clauses table (emphasis mine):

    Limits the result set to those entities that meet one or more conditions. Each condition compares a property of the entity with a value using a comparison operator. If multiple conditions are combined with the AND keyword, then an entity must meet all of the conditions to be returned by the query. GQL does not have an OR operator.

    0 讨论(0)
提交回复
热议问题