Retrieving User's one-to-many and one-to-one collections using Swift

Hi
I am scratching my head over this for a while without success.
So far, I am able to:

  1. login
  2. Get user information like name
  3. get user sample property like contact number
    But do I retrieve the collections objects using the backendless user object?
    for example, I have a one-to-many relationship from user to customers table.
    How do I access the customers for a particular user?
    HELP!

You should investigate the docs:

Hi

I tried this but get back zero data:









Types.tryblock({ () -> Void in

            let user = self.backendless.userService.currentUser

            let objectID = user.objectId

            

            let queryOptions = QueryOptions()

            queryOptions.relationsDepth = 1;




            let dataQuery = BackendlessDataQuery()




            var queryString = "Users[cases].objectId = \'\(objectID)\'"

            dataQuery.whereClause = queryString

            dataQuery.queryOptions = queryOptions;




            var error: Fault?

            let bc = self.backendless.data.of(Cases.ofClass()).find(dataQuery, fault: &error)

            if error == nil {

                print("Cases have been retrieved: \(bc.data)")

            }

            else {

                print("Server reported an error: \(error)")

            }

            

                       },

            catchblock: { (exception) -> Void in

                        print("searchingDataObjectByDistance (FAULT): \(exception as! Fault)")

        })

There are no errors or exception, just zero data.

I do have data in my tables

Please provide your Cases class here

Found the problem. It was the relations depth; need to set 2 to get results.