Lambda过滤器是否允许在日历事件集合的子属性上?

huangapple go评论51阅读模式
英文:

Are lambda filters on subproperties of calendar event collections allowed?

问题

lambda operators 文档中有一些在 Graph Explorer 中正常运行的子属性过滤示例:

但是在日历事件复杂属性集上执行类似以下查询会返回“无效过滤器”错误消息:

对于简单事件 字符串 集合 '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 &#39;admin@contoso.com&#39;)
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 &#39;&#39;)
https://graph.microsoft.com/v1.0/me/calendar/events?$filter=location/any(i:i/address eq &#39;here&#39;)

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 &#39;something&#39;)

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 &#39;Microsoft Teams Meeting&#39;

但是,通过locations筛选事件对我来说返回的结果为空:

GET https://graph.microsoft.com/v1.0/me/calendar/events?$filter=locations/any(e:e/displayName eq &#39;Microsoft Teams Meeting&#39;)

根据我的经验,通过集合属性筛选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 &#39;Microsoft Teams Meeting&#39;

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 &#39;Microsoft Teams Meeting&#39;)

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.

huangapple
  • 本文由 发表于 2023年2月24日 16:30:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/75554213.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定