Case insensitive where clause in gql query for StringProperty

前端 未结 3 2038
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-06 11:10

Using the google appengine datastore, is there a way to perform a gql query that specifies a WHERE clause on a StringProperty datatype that is case insensitive? I am not al

3条回答
  •  一向
    一向 (楼主)
    2020-12-06 11:34

    The datastore doesn't support case insensitive comparisons, because you can't index queries that use them (barring an index that transforms values). The solution is to store a normalized version of your string in addition to the standard one, as Peter suggests. The property classes in the AETycoon library may prove helpful, in particular, DerivedProperty.

提交回复
热议问题