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

RCPP-82 Add missing query operators for managed<std::map<std::string, T>> #225

Merged
merged 7 commits into from
Jul 4, 2024

Conversation

leemaguire
Copy link
Contributor

@leemaguire leemaguire commented Jul 1, 2024

Fixes #224

Add ability to use managed<std::map<std::string, T>> in type safe queries when comparing a value for a key. e.g.
realm.object<MyObject>().where([](auto& o) { return o.my_map["foo_key"] == "some value"; })
Supported operators are ==, !=, >, <, >=, <= and contains(const std::string&).

@leemaguire leemaguire self-assigned this Jul 1, 2024
@leemaguire leemaguire marked this pull request as ready for review July 2, 2024 10:26
@leemaguire leemaguire requested a review from kneth July 2, 2024 10:27
Copy link
Contributor

@kneth kneth left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -255,7 +255,7 @@ namespace realm::internal::bridge {
if (rhs) {
return *std::dynamic_pointer_cast<::realm::Columns<StringData>>(m_subexpr) == *rhs;
} else {
return *std::dynamic_pointer_cast<::realm::Columns<StringData>>(m_subexpr) >= ::realm::null();
return *std::dynamic_pointer_cast<::realm::Columns<StringData>>(m_subexpr) == ::realm::null();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a bug fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I will add this to the changelog

@leemaguire leemaguire merged commit 1bf2799 into main Jul 4, 2024
33 of 50 checks passed
@leemaguire leemaguire deleted the lm/map-rbool branch July 4, 2024 10:56
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix queries on std::map
2 participants