Multple relations query

I wonder how can i achieve this:

A restaurant has several branches (array of), each of those branches has a zone, and that zone has a name.

I need to find the restaurants that have branches in a given zone. I tried with this BackEndles query:

         var restaurantsRaw = Backendless.Persistence.of(Restaurant);
        var dataQuery = { condition: "BRANCHES.ZONE.ZONE_NAME=Test Zone" , options: {pageSize:100 }};

But i get “unknown columnTest Zone”. What should be the right syntax?

Hi, Nicolas,

Try enclosing the zone name into quotes:

var dataQuery = { condition: "BRANCHES.ZONE.ZONE_NAME='Test Zone'" , options: {pageSize:100 }};

worked like a charm! Thank you