Is $filter eq case sensitive or not?

David Wong 46 Reputation points
2023-05-02T07:20:33.84+00:00

I expect 'eq' in $filter is case sensitive, i.e. searching for $filter="displayName='John'" will not match ‘john’. People had asked how to do case insensitive search such as:

However, as I tested recently. It is case insensitive. My case is filter user records in Azure AD B2C. Is there any official document about this?

Microsoft Security | Microsoft Graph
0 comments No comments
{count} vote

3 answers

Sort by: Most helpful
  1. Jiri Formacek 6 Reputation points
    2024-09-12T08:44:01.9833333+00:00

    Looking into ODATA specs: https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_Equals

    Equals operators says values must be equal, which suggests case-sensitive comparison

    Functions like startswith explicitly specify comparison as case sensitive, and also mention that case-insensitivity shall be achieved via toupper() and tolower() functions

    I have good experience with toupper()

    hope this helps

    1 person found this answer helpful.
    0 comments No comments

  2. TH-4749-MSFT 3,315 Reputation points
    2023-05-03T19:26:53.2166667+00:00

    Hi David Wong,

    Thanks for reaching out. According to OData documentation :

    OData Protocol V4.01 based services support case-insensitive system query option names specified with or without the $ prefix.

    This applies to Microsoft Graph.

    Thanks.


  3. TH-4749-MSFT 3,315 Reputation points
    2023-05-29T17:07:00.59+00:00

    Hi David Wong,

    Hope all is well. If the previous reply was helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    Thanks.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.