Support IsEmpty and IsNotEmpty keywords in derived queries#5147
Support IsEmpty and IsNotEmpty keywords in derived queries#5147backend-choijunhyeong wants to merge 1 commit intospring-projects:mainfrom
IsEmpty and IsNotEmpty keywords in derived queries#5147Conversation
|
I'd like to clarify the expected behavior regarding Current implementation
This means Question Options
I can adjust the implementation based on the team's preference. |
|
Thank you @backend-choijunhyeong for putting time into this. I think the handling of
Having some integration tests in Let me know if that helps and if you'd like to continue working on the issue or if we should take it from here. |
|
Thank you for the feedback @christophstrobl ! I'd like to continue working on this. I will
I'll update the PR once the changes are ready. |
e510458 to
6b33a78
Compare
|
I have updated the implementation to address your feedback
Question Thank you for the review. |
Add IS_EMPTY and IS_NOT_EMPTY case handling to MongoQueryCreator. For String properties, compare with empty string using $eq/$ne. For Collection properties, use $size operator. For Map and other types, compare with empty document. Signed-off-by: backend-choijunhyeong <ajfeh22@gmail.com>
6b33a78 to
4804b77
Compare
Add support for
IsEmptyandIsNotEmptyrepository query keywords in derived queries.Why
The documentation lists
IsEmptyas a supported keyword, but it throws"Unsupported keyword" exception when used.
Changes
IS_EMPTYandIS_NOT_EMPTYcase handling inMongoQueryCreator.from()createIsEmptyCriteria()andcreateIsNotEmptyCriteria()methods{ field: { $eq: "" } }/{ field: { $ne: "" } }{ field: { $size: 0 } }/{ field: { $not: { $size: 0 } } }Resolves #4606