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

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

问题描述

我试图在/users查询中使用 contains 过滤器,例如: https://graph.microsoft.com/v1.0/users ?$ filter = contains(displayName,'Garth')

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

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

解决方案

contains函数不适用于用户.但是startsWith可用.
例如 https://graph.microsoft.com/v1.0/users?$filter=startswith(displayName,'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')

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."

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?

解决方案

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天全站免登陆