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

[v4] Filter result by Embedded object property in list? #109

Open
vuitv opened this issue Oct 31, 2024 · 1 comment
Open

[v4] Filter result by Embedded object property in list? #109

vuitv opened this issue Oct 31, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@vuitv
Copy link

vuitv commented Oct 31, 2024

isar v4: I have object with list of Embedded objects. Is it possible to filter result by Embedded object property in list?

@vuitv vuitv added the enhancement New feature or request label Oct 31, 2024
@chan150
Copy link

chan150 commented Jan 10, 2025

Here is a example code of filtering embedded object.

// use this in main logic
final embeddedFiltering = isar.simpleRecords.where().simpleEmbedded((q) => q.dataElementBetween(1, 2)).findAll();

// simple_record.dart
@collection
class SimpleRecord {
  late int id = isar.simpleRecords.autoIncrement();

  List<int> data = List.generate(1, (i) => i);

  SimpleEmbedded? simpleEmbedded = SimpleEmbedded();
}

@embedded
class SimpleEmbedded {
  List<int> data = List.generate(10, (i) => i);
}

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

No branches or pull requests

2 participants