objectbox flutter select specific property or get all object which have unique property value
You want to have a look at regular queries (not property queries). I imagine it could look like something like this:
Query<Client> query = box.query(client_.clientName.equals('Joe')).build();
List<Client> joes = query.find();
Now, having a the entire object(s), you can easily access any property.
fabien piron
Updated on November 25, 2022Comments
-
fabien piron over 1 year
I have an object entity in which i store many fields including clientNumber and clientName . I know that i can use property query on the clientNumber field but i wouldn't get the clientName, i also know that in objectbox for java there is a filter method that might solve my problem, but appart from retrieving all the clients and filtering data manually i don't know any other way to do it with flutter .
Could you tell me if there is a more elegant way to achieve the same result ?
Thank you by advance for your answer, and for the great product that is objectbox
-
fabien piron about 2 yearsThank you for your answer, that's what i end up doing, being used to sql database i imagined that there was another solution but i know now that it's not the case
-
Markus Junginger about 2 yearsYes, it's a common perception coming from SQL; maybe it's worth a FAQ entry.