I have a table UserGroups and it has a one-many relation with users table. I am trying to fetch user records from UserGroups using the following code:
let dataQuery = BackendlessDataQuery()
dataQuery.whereClause = "UserGroups[users].email = \'\(email)\'"
var error: Fault?
let bc = backendless.data.of(UserGroups.ofClass()).find(dataQuery, fault: &error)
if error == nil {
let contacts = bc.getCurrentPage()
for theGroup in contacts as! [UserGroups]{
print(theGroup.users)
}
}
else {
print("Server reported an error: \(error)")
}
I am getting the following error: Server reported an error: Optional(FAULT = ‘1017’ [Invalid where clause. Specified Entity: UserGroups[users] is not related to lowerLevelEntity: UserGroups]
Can you please tell me if I am doing anything wrong?
distance( 17.438975,78.4000716, geoPoint.latitude, geoPoint.longitude ) < km(1) and (ParkingLot[bike].availableSlots > 0 OR ParkingLot[car].availableSlots > 0)
where,
availableSlots is column in Bike and Car table.
I want to load parking Lots where bike and car availableSlots are greater than 0.
ParkingLot table has one to one relation with Bike and Car table