0

我有一个列表/库,可以说 20 列(字段),在我的 REST 查询中,我只希望返回 2 个字段,而不是全部 20 个。我该如何做到这一点:

当前查询:

http://server/site/collection/_vti_bin/ListData.svc/MyList?$filter=Name eq 'Username' and SomeField ne null&$orderby=DateFrom desc&select=field1,field2

但这总是返回所有 20 个字段。$select 不应该只返回我在 URL 中提供的字段吗?

4

1 回答 1

2

哦,我刚刚再次检查了 URL,发现我忘记了 select 语句中的“$”。所以应该是:

http://server/site/collection/_vti_bin/ListData.svc/MyList?$filter=Name eq 'Username' and SomeField ne null&$orderby=DateFrom desc&$select=field1,field2
于 2013-09-01T08:05:24.953 回答