Hello,
I have yet another Flutter question! This time I am struggling with where clauses on a relation column
I have a Category
table (see below):
I also have an Exhibit
table that contains a 1:N
relation column with the Category
table called linkedCategories
(see below):
Is there a way to retrieve every sculpture exhibition from the Exhibits
table? I.e. where the linkedCategories
column contains the objectId
for the sculpture category?
Currently I have tried the following:
static Future<List<Exhibit?>?> fetchExhibitWithCategoryId(
Category category) async {
var query = DataQueryBuilder()..related = ['linkedCategories'];
String whereClause =
"Exhibit[linkedCategories].objectId = '${category.objectId}'";
DataQueryBuilder queryBuilder = query..whereClause = whereClause;
var dbdata = Backendless.data
.withClass<Exhibit>()
.find(queryBuilder)
.then((exhibits) {
logger.d(exhibits); // returns []
return exhibits;
});
return dbdata;
}
All 3 exhibits in the Exhibit table contain the sculpture category. What am I doing wrong?