OData查询$ filter条件和区分大小写 [英] OData query $filter conditions and case-sensitivity
本文介绍了OData查询$ filter条件和区分大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
OData是否指定对字符串字段的过滤条件是区分大小写还是不区分大小写?
Does OData specify whether filter conditions on string fields are to be evaluated case-sensitively or case-insensitively?
示例:(来自文档)
/Suppliers?$filter=Address/City eq 'Redmond'
这是否区分大小写?
如果我想同时提供这两种选择,该如何表达?有一个tolower()函数可以像这样使用:
If I want to offer both options, how can this be expressed? There is a tolower() function that can be used like:
/Suppliers?$filter=tolower(Address/City) eq 'redmond'
或
/Suppliers?$filter=tolower(Address/City) eq tolower('Redmond')
没有一种更简洁的方式来表示不区分大小写的匹配吗?
Isn't there a more concise way to express case-insensitive matching?
推荐答案
"eq"运算符应该区分大小写.当前建议使用tolower(或toupper).
The "eq" operator is supposed to be case sensitive. Usage of tolower (or toupper) is the currently recommended way of doing this.
这篇关于OData查询$ filter条件和区分大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文