Querying a table using a 1:N relationship

I have a table “bands” with a column named “members”.
The members column is a 1:N relationship to the Users table.

I want to run a query to return bands where the current user is included as one of the members.

I am trying to use this:

var whereClause = "bands[members].objectId='" + currentUser.objectId + "'";
var queryBuilder = Backendless.DataQueryBuilder.create().setPageSize( 20 );
queryBuilder.setWhereClause( whereClause );
queryBuilder.setRelated( [ "members" ] );
Backendless.Data.of( "bands" ).find( queryBuilder )
.then( function( result ) {

This is not returning anything even though I have my user included in the members list.
Am I configuring the query correctly?

Hello @Tony_Goodchild,

you are querying against a bands table, so using bands in your bands[members].objectId= query is redundant (there’s no such a column in that table).
Just use "members.objectId='" + currentUser.objectId + "'";


Thanks @stanislaw.grin