Hello!
I want to get one specific Exhibit
from the database by searching the relevant table for its id which I pass in. I also want to get all it’s relation information as well, but am struggling to do this from the docs.
When I hover over findById
it tells me I can have a queryBuilder
as optional, but I am struggling to pass it in correctly. The following is my code as it stands:
static fetchExhibitWithRelationsById(String id) {
var query = DataQueryBuilder()
..related = ['linkedVenue', 'linkedCategories']
..whereClause = 'objectId=\'$id\'';
var dbdata = Backendless.data
.withClass<Exhibit>()
.findById(id, query) // errors here!
.then((exhibits) {
return exhibits;
});
return dbdata;
}
The error says: “Too many positional arguments: 1 expected, but 2 found”. Any help would be much appreciated, as always