2

I am using jQuery to get information from SharePoint 2010's listData.svc. I noticed some inconsistencies with regards to case sensitivity in my queries:

  • The following command is case sensitive:

    ...&$filter=substringof('String', property) eq True

  • The following command is case insensitive

    ...&$filter=substringof(tolower('String'), tolower(property)) eq True

  • The following command is also case insensitive but much shorter:

    ...&$filter=substringof('String', property) or substringof('String', property2)

  • However, the case insensitivity using the short method is lost for the entire filter when one part is using a property more than two levels down. So in the following command the entire filter becomes case sensitive again:

    ...&$filter=substringof('String', property/property/property) or substringof('String', property2)

Is this an issue with SharePoint's service? Or am I just doing something wrong?

4

1 回答 1

0

这似乎是 ListData.svc 中的一个错误。

如果比较(在一天结束时委托给 SQL Server)在任何查询中都区分大小写,则它们应该始终区分大小写。

显然,无论案例是否匹配,tolower 调用都会使事情匹配,因此我们可以忽略它。但是我不知道为什么对另一个属性进行 OR 操作。

它可能是 SharePoint 中的一个错误,或者您可能无意中选择了一个 OR 子句,该子句会返回您意外期望的数据。

于 2012-09-04T17:36:41.383 回答