包含 Microsoft Graph 查询上的筛选器不起作用 [英] Contains filter on Microsoft Graph query not working

查看:21
本文介绍了包含 Microsoft Graph 查询上的筛选器不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在/users 查询中使用 contains 过滤器,例如:https://graph.microsoft.com/v1.0/users?$filter=包含(显示名称,'Garth')

I'm trying to user the contains filter on a /users query, like this for example: https://graph.microsoft.com/v1.0/users?$filter=contains(displayName, 'Garth')

但是,这会导致 BadRequest 响应说发现了一个名为 'contains' 的未知函数.这也可能是对导航属性的键查找,这是不允许的."

However, this results in a BadRequest response saying "An unknown function with name 'contains' was found. This may also be a key lookup on a navigation property, which is not allowed."

根据 OData 4.0 规范,包含过滤器应该可用.有没有办法在用户列表上使用包含过滤器?

According to the OData 4.0 specs, the contains filter should be available though. Is there a way to use a contains filter on a list of users?

推荐答案

contains 功能对用户不可用.startsWith 是可用的.
例如https://graph.microsoft.com/v1.0/users?$filter=startswith(displayName,'Garth').

The contains function is not available for users. startsWith is available though.
e.g. https://graph.microsoft.com/v1.0/users?$filter=startswith(displayName,'Garth').

这篇关于包含 Microsoft Graph 查询上的筛选器不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆