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

Adding an example of querying in C++ README #33

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MarcusSorealheis
Copy link

In this simple PR, I've added an example for querying in Realm with C++. I recognize that there are other ways to accomplish the same thing and I also recognize that I may not have built things the best way. I saw the issue open as I was digging into Realm and thought I could put this up for good measure while it was top of mind. :)

README.md Outdated
auto realm = realm::open<Person, Dog>({.path=path});
auto results = realm.objects<Person>().where("age > $0", {20});

return results.size();
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey Marcus - saw you put this up - it's nice to see an example of query here. For what it's worth, I and a couple other folks on the docs team have started working on building out docs for the C++ Alpha and have discovered there's some nuance to using the query results. It would be great to see an example here of doing something with the results, instead of just returning the size.

Copy link
Author

Choose a reason for hiding this comment

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

@dacharyc done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants