仅返回Sharepoint 2010中REST查询中的特定字段

时间:2013-08-30 18:50:55

标签: rest sharepoint-2010

我有一个列表/库,可以说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中给出的字段吗?

1 个答案:

答案 0 :(得分:2)

doh,我刚刚再次检查了网址,注意到我在select语句中忘记了'$'。所以它应该是:

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