Help me make correct WhereClause with relationships

Hello
I have a problem. I can’t make correct whereClause for query with relationships.
For example I have Article entity and Comment entity. Comment entity have point to Article. I have to get all Comments for current Article.
I try make next:
BackendlessDataQuery *query = [BackendlessDataQuery query];
query.whereClause = [NSString stringWithFormat:@“article.objectID = %@”, self.article.objectId];
and this:
BackendlessDataQuery *query = [BackendlessDataQuery query];
query.whereClause = [NSString stringWithFormat:@“article = %@”, article];
[[[Backendless sharedInstance] persistenceService] find:[Comment class] dataQuery:query response:^(BackendlessCollection *objects) {

} error:^(Fault *error) {

}];
Can you help me?

Assuming the relation is defined in the Comment table. The name of the relation column is “relatedArticle”. In this case to get all comments for an article, you need to use the following whereClause:

relatedArticle.objectId = ‘value-of-object-id’

You can test this query using Backendless console. Here’s how you to do it:
https://backendless.com/feature-14-sql-based-search-for-data-objects-using-console/

Regards,
Mark

Thanks. I lose quotes :slight_smile: