Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FMWK-179 Find by map/list containing: similar logic, multiple arguments #576

Merged
merged 7 commits into from
May 23, 2023

Conversation

agrgr
Copy link

@agrgr agrgr commented May 23, 2023

No description provided.

@agrgr agrgr requested a review from reugn May 23, 2023 11:44
params.add(0, value1); // value1 stores the first parameter
if (op == MAP_VAL_CONTAINING_BY_KEY || op == MAP_VAL_EQ_BY_KEY) {
if (params.size() > 2) {
if ((params.size() & 1) != 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

params.size() % 2 != 0

return aerospikeCriteriaAndConcatenated(params, qb, part, fieldName, op, dotPath, true);
} else if (params.size() == 2) {
setQbValuesForMapByKey(qb, params.get(0), params.get(1));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if params.size() < 2?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then the default flow continues with just the op set before and the logic in these conditions is not applied.

List<Object> params = new ArrayList<>();
parameters.forEachRemaining(params::add);

if (params.size() >= 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use !isEmpty

if (IndexUtils.isFindByPojoSupported(client)) {
List<String> listToCompareWith = List.of("str1", "str2");
assertThat(dave.getStrings()).isEqualTo(listToCompareWith);
// if (IndexUtils.isFindByPojoSupported(client)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be removed?

@agrgr agrgr merged commit 7e24934 into main May 23, 2023
@agrgr agrgr deleted the FMWK-179-findByMapContaining branch May 23, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants