英文:
Are lambda filters on subproperties of calendar event collections allowed?
问题
lambda operators 文档中有一些在 Graph Explorer 中正常运行的子属性过滤示例:
- https://graph.microsoft.com/v1.0/users?$filter=imAddresses/any(i:i eq 'admin@contoso.com')
- https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses/any(s:s/skuId eq 184efa21-98c3-4e5d-95ab-d07053a96e67)
但是在日历事件复杂属性集上执行类似以下查询会返回“无效过滤器”错误消息:
- https://graph.microsoft.com/v1.0/me/calendar/events?$filter=attendees/any(e:e/emailAddress eq '')
- https://graph.microsoft.com/v1.0/me/calendar/events?$filter=location/any(i:i/address eq 'here')
对于简单事件 字符串 集合 'categories' 上的查询有效:
日历事件集合的子属性的 lambda 过滤器是否允许?<br />
我的查询语法是否不正确?
(已使用 consistencylevel:eventual
标头进行测试,似乎不需要)
英文:
The documentation about lambda operators has some examples of filtering on subproperties that work fine in Graph Explorer:
https://graph.microsoft.com/v1.0/users?$filter=imAddresses/any(i:i eq 'admin@contoso.com')
https://graph.microsoft.com/v1.0/users?$filter=assignedLicenses/any(s:s/skuId eq 184efa21-98c3-4e5d-95ab-d07053a96e67)
But queries like these on calendar event complex property collections give me 'invalid filter' error messages:
https://graph.microsoft.com/v1.0/me/calendar/events?$filter=attendees/any(e:e/emailAddress eq '')
https://graph.microsoft.com/v1.0/me/calendar/events?$filter=location/any(i:i/address eq 'here')
A query on the simple event string collection 'categories' works:
https://graph.microsoft.com/v1.0/me/calendar/events?$filter=categories/any(i:i eq 'something')
Are lambda filters on subproperties of calendar event collections (not) allowed?<br />
Is my query syntax incorrect?
(Tested with consistencylevel:eventual
header, which seems to be unnecessary)
答案1
得分: 0
根据此评论,Graph API不支持按与会者筛选事件。
要通过location
及其displayName
筛选事件,请使用以下方法:
GET https://graph.microsoft.com/v1.0/me/calendar/events?$filter=location/displayName eq 'Microsoft Teams Meeting'
但是,通过locations
筛选事件对我来说返回的结果为空:
GET https://graph.microsoft.com/v1.0/me/calendar/events?$filter=locations/any(e:e/displayName eq 'Microsoft Teams Meeting')
根据我的经验,通过集合属性筛选Graph API资源在不同资源之间有所不同。有时它可以正常工作,有时它不受支持。
英文:
According this comment Graph API doesn't support filter events by attendees.
For filtering events by location
and its displayName
use
GET https://graph.microsoft.com/v1.0/me/calendar/events?$filter=location/displayName eq 'Microsoft Teams Meeting'
But filtering events by locations
returns empty results for me
GET https://graph.microsoft.com/v1.0/me/calendar/events?$filter=locations/any(e:e/displayName eq 'Microsoft Teams Meeting')
From my experience filtering Graph API resources by a collection property differs from resource to resource. Sometimes it's working fine sometimes it's not supported.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论