SimpleIdServer icon indicating copy to clipboard operation
SimpleIdServer copied to clipboard

Filtering case insensitive Mongo db

Open gabrielemilan opened this issue 3 years ago • 7 comments

Hello,

I have a question about filtering. I notice that the filtering in mongo is case sensitive, but there is a property in schema "caseExact" that I think you have to manage, right?

Maybe in SQL it works because by default Sql search has case insensitive search.

Am I right?

Thanks. Gabriele

gabrielemilan avatar Jan 12 '21 18:01 gabrielemilan

Hello,

Indeed there is an issue in the project "SimpleIdServer.Scim.Persistence.MongoDB" , the "caseExact" property must be used. I'm going to work on it.

simpleidserver avatar Jan 15 '21 11:01 simpleidserver

The issue should be fixed in the branch "origin/release/1.2.0". Can-you try again with the latest changes ?

simpleidserver avatar Jan 15 '21 16:01 simpleidserver

It works, many thanks :-)

gabrielemilan avatar Jan 16 '21 12:01 gabrielemilan

Hello, it seems that is not working using "eq" filter anymore.

/Users?filter=name.familyName eq "name" it doesn't work, it returns empty data /Users?filter=name.familyName sw "name" it works properly

Regards. Gabriele

gabrielemilan avatar Jan 21 '21 12:01 gabrielemilan

Hi,

Indeed there is an issue with the "equality" filtering when the property "CaseExact" is set to "False". When this property is "false" then the LINQ expression is not properly parsed by the library "MongoDB.Driver". I opened an issue in the project to fix this issue : https://github.com/mongodb/mongo-csharp-driver/pull/440 KR

simpleidserver avatar Jan 22 '21 14:01 simpleidserver

@simpleidserver since the release 1.2.0 has been delivered, I think that is better to revert the changes regarding the CaseExact.

What do you think?

gabrielemilan avatar Mar 10 '21 16:03 gabrielemilan

Hello,

The changes have been rolled back in the branch "release/1.2.1".

A bug has been reported in the MongoDB project, the advancement can be followed here : https://jira.mongodb.org/browse/CSHARP-3425?jql=project%20%3D%20CSHARP%20AND%20resolution%20%3D%20Unresolved%20AND%20text%20~%20%22ToLower%22%20ORDER%20BY%20priority%20DESC%2C%20updated%20DESC. The CaseExact parameter will be supported by SimpleIdServer when Invariant comparison will be supported by the mongo-csharp-driver library.

simpleidserver avatar Mar 10 '21 21:03 simpleidserver