Open sikandar opened 1 week ago
@sikandar Please sign the Contributor License Agreement!
Click here to manually synchronize the status of this Pull Request.
See the FAQ for frequently asked questions.
@sikandar Thank you for signing the Contributor License Agreement!
Thank you for getting in touch. Please explain why you think this is necessary and provide throughout testcases for the proposed change since there's a method that accepts a Collection
.
As {"$in" : [["n1", "n2"]]}
matches differently from {"$in" : ["n1", "n2"]}
I think revisiting the arrangement makes sense.
If there is a nullable list with values, the implementation should check it instead of wrapping the nullable list (even if it has values) into another newly created list by the Criteria class.
Existing
Code:
if (!filter.ids.isNullOrEmpty()) criteria.and("id").
in(filter.ids)
Output:{"id" : { "$in" : [["667e8b8af76f17213e4d4280"]]}}
WrongCode:
if (!filter.ids.isNullOrEmpty()) criteria.and("id").
in(filter.ids!!)
Required !! Output:{"id" :{ "$in" : ["667e8b8af76f17213e4d4280"]}}
CorrectAfter Fix
Code:
if (!filter.ids.isNullOrEmpty()) criteria.and("id").
in(filter.ids)
With and Without !! Output:{"id" : { "$in" : ["667e8b8af76f17213e4d4280"]}}
Correct