2 Depth Where Clause

If an “Users” table had a 1 to many relationship with an “Orders” table which had a 1 to many relationship with an “Address” table. Is there a single where clause that we can write in the address table to get a return of Addresses? The addresses that get returned should be the ones that are related to the user that we select from the users table.

When we write the where clause for the Address table, to search this data, the where clause string exceeds the character limit because in the where clause we have to identify all the Orders that the user has a relationship with using “OR”.

When we use the iOS SDK we are able to successfully get the data but when we make API calls, we are not able to get the data because the character limit of the URI and the length of the where clause. If there is a simpler where clause that would be very helpful.

Basically we want to pull data from two depths but return them as an array of Addresses sorted by created date opposed to Addresses that are nested under each individual Order when we pull a User’s orders with a depth of 2.

If there is no way to do a SQL search using a where clause to get two depths, is there a way to get around the length of the where clause in an API call?

Hi Nevin,

Please, try to use the next where clause string in the request to the “Addresses” table

Orders[addresses].Users[orders].objectId = '<%userObjectId%>'

Where:

  • “addresses” is the name of the column that is related to the “Addresses” in table “Orders”
  • “orders” is the name of the column that is related to the “Orders” in table “Users”

Regards Ilya

Perfect. Nothing better than waking up to this! Thanks a lot for your quick responses.