I have a Users class with a collection column titled ‘following’. Many Users can follow one artist of the Artist Class. Now, in my Artist class I have a column written Users.following that was generated from the relation I made from the User Class from that following column.
How then do i retrive the users following an Artist in my artist class i.e Users.following? I have tried the following and i get the error (Server reported an error: Optional(FAULT = ‘1023’ [Unable to retrieve data. Query contains invalid object related properties.] <Unable to retrieve data. Query contains invalid object related properties.> )):
let dataQuery = BackendlessDataQuery()
dataQuery.whereClause = "artist = \'\("Ngoni")\'"
let queryOptions = QueryOptions()
queryOptions.related = ["Users.following" ,"Users"]; //I even tried vice-versa
dataQuery.queryOptions = queryOptions
var error: Fault?
let bc = backendless.data.of(Artist.ofClass()).find(dataQuery, fault: &error)
if error == nil {
print("Orders have been retrieved: \(bc.data)")
}
else {
print("Server reported an error: \(error)")
}
I have also tried making a variable in my Swift definition class called Users.followers BUT because of the ‘dot’ in Users.followers it suggests i place a comma which becomes totally wrong. Please help sob sob