-
Notifications
You must be signed in to change notification settings - Fork 134
Query with linkMany does not provide value if there are no entities in ToMany relation #403
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
Comments
Thanks for the report. However, why would you expect a query with the Note that typically the link conditions are used with a condition on the related entity, so e.g. |
I think I see where my expectation does not meet the reality - I don't pass any condition to the The workaround I use right now uses 2 instances of the same query. One of them without final qBuilder1 = noteBox.query()
..order(Note_.date, flags: Order.descending)
..linkMany(Note_.attachment);
final qBuilder2 = noteBox.query()
..order(Note_.date, flags: Order.descending);
return Rx.merge([qBuilder1.watch(triggerImmediately: true), qBuilder2.watch(triggerImmediately: true)])
.distinct();
|
Got it. In that case I recommend to write your own objectbox-dart/objectbox/lib/src/native/query/builder.dart Lines 33 to 53 in d72f51e
Then you can use any query you want with it. |
Without additional information, we are unfortunately not sure how to resolve this issue. Therefore this issue has been automatically closed. Feel free to comment with additional details and we can re-open this issue. |
Basic info (please complete the following information):
Steps to reproduce
Example available here
..linkMany(Entitiy_.relation)
objectbox.dart
file, hot restart the app, and observe this entity to be shown againExpected behavior
Query using
.linkMany
should emit values also when there are no entities in the ToMany relationCode
Sample available here https://github.com/objectbox/objectbox-dart/pull/402/files
The text was updated successfully, but these errors were encountered: