如何在 Microsoft Graph 的扩展集合中过滤和 select?

How do I filter and select inside a expanded collection on Microsoft Graph?

此代码有效

https://graph.microsoft.com:443/v1.0/me/drive/root?$filter=Size eq 0&$expand=children($select=id,folder,name,parentReference,cwebUrl)&$select=Id,folder,name,parentReference,children,webUrl

我想在 children:

里面过滤
https://graph.microsoft.com:443/v1.0/me/drive/root?$filter=Size eq 0&$expand=children($select=id,folder,name,parentReference,cwebUrl&$filter=Size eq 0)&$select=Id,folder,name,parentReference,children,webUrl

当 filtering/selecting 在展开时,您需要使用 ; 作为分隔符,而不是 &。所以你的 URL 应该是:

https://graph.microsoft.com:443/v1.0/me/drive/root?$filter=Size eq 0&$expand=children($select=id,folder,name,parentReference,cwebUrl;$filter=Size eq 0)&$select=Id,folder,name,parentReference,children,webUrl

这是 TripPin 示例 OData 服务上的一个 URL 示例,用于展示此操作:

http://services.odata.org/V4/TripPinServiceRW/People?$expand=Trips($select=TripId,Name,Description;$filter=TripId eq 0)