You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Entity()
class Post {
int id;
List<String>? readByIds
// other properties
queryObject({this.id = 0, this.readByIds});
}
And I would like to be able to retrieve Posts I have not read. It would be useful if the generated metadata had the .notContains function for this kind of situation. i.e box.query(Post_.notContains(userId))
In my situation I know all the ids of who could read it, and so have added an extra property that is the inverse readByIds:
@Entity()
class Post {
int id;
List<String>? readByIds;
List<String>? notReadByIds;
// other properties
queryObject({this.id = 0, this.readByIds, this.notReadByIds});
}
but the duplication makes this undesirable
The text was updated successfully, but these errors were encountered:
BTW, this looks like a good candidate for a separate "table" with the list of which items have been read by which user (assuming that's what you mean by readByIds), e.g.
@Entity()
classPost {
int id;
...
}
@Entity()
classPostReads {
int id;
final post =ToOne<Post>();
final user =ToOne<User>();
}
vaind
added
the
on-hold
Blocked by some other issue or a lack of information/ideas how to proceed.
label
Jul 28, 2021
greenrobot-team
added
duplicate
This issue or pull request already exists
and removed
on-hold
Blocked by some other issue or a lack of information/ideas how to proceed.
labels
Feb 28, 2024
I have an object that looks like
And I would like to be able to retrieve Posts I have not read. It would be useful if the generated metadata had the .notContains function for this kind of situation. i.e
box.query(Post_.notContains(userId))
In my situation I know all the ids of who could read it, and so have added an extra property that is the inverse readByIds:
but the duplication makes this undesirable
The text was updated successfully, but these errors were encountered: