I made a query to go through the “Users” table then retrieving the data of each user. This is return in the form of an NSArray. Information included details such as their name, password & other custom relations made. My main concern in this case, is the data contained within the custom relation. Each time I post, I’m directed to the documentation on use of relations but that doesn’t seem to apply to my question, as the methods in the example do not provide a solution.
I believe my situation to be a special case. All I am requesting is that you make a similar query & guide me on how I can retrieve the information I need.
Please find the query in question below:
let dataQuery = BackendlessDataQuery()
let queryOptions = QueryOptions()
queryOptions.related = ["Likes", "Likes.trackTitle"];
dataQuery.whereClause = "name = \'\(user.name)\'"
dataQuery.queryOptions = queryOptions
let bc = self.backendless.persistenceService.find(Users.ofClass(), dataQuery:dataQuery) as BackendlessCollection
I’ve attached the output. All I want is the list of likes, as follows.
likes = (
“<Yzia.Songs: 0x7fd67a1ef470>”,
“<Yzia.Songs: 0x7fd67a1f0690>”,
“<Yzia.Songs: 0x7fd67a1f1c70>”,
“<Yzia.Songs: 0x7fd67a1f3220>”,
“<Yzia.Songs: 0x7fd67a1f4780>”,
“<Yzia.Songs: 0x7fd67a1f5f40>”,
“<Yzia.Songs: 0x7fd67a1f74e0>”,
“<Yzia.Songs: 0x7fd67a1f8a90>”,
“<Yzia.Songs: 0x7fd67a1fa070>”,
“<Yzia.Songs: 0x7fd67a1fb610>”,
“<Yzia.Songs: 0x7fd67a400c20>”,
“<Yzia.Songs: 0x7fd67a402230>”
);
Please find a screenshot of my Users table attached as well as the output when I print bc.data below.