İnvalid Where Clause

Hi Backendless Team,
I have a problem. Why this code get error ? ( invalid Where Clause ) user_id that in house table column is related with users table.
let user = backendless.userService.currentUser
let query = BackendlessDataQuery()
query.whereClause = “user_id = (user)”
response: { ( houses : BackendlessCollection!) -> () in
let currentPage = houses.getCurrentPage()

for selector in currentPage as! [House] {

Hi Alican,

The problem is in this line:

query.whereClause = "user_id = \(user)"

It should be written like this (string values must be surrounded by single quotes):

query.whereClause = "user_id = '\(user)'"


Hi Mark,I tried your suggestion but it doesn’t work.

ERROR: Server reported an error: FAULT = ‘1017’ [Invalid where clause: Unknown column 'where clause] <Invalid where clause: Unknown column 'where clause>

user_id column is in House table.user_id related with user table,Why do I take this error ?;/img&gt;

How should WhereClause be for relationship column ?

Since user_id is a relation column, you must reference a PROPERTY of the related object:

user_id.objectId = ‘value’

Thank you Mark.

I’m having the same issue in Java.

BackendlessDataQuery rQuery = new BackendlessDataQuery();
String whereClause = “recipeName =” + recipe_name;

You need to surround the recipe_name with single quotes or backticks.

String whereClause = "recipeName='" + recipe_name + "'";


String whereClause = "recipeName=`" + recipe_name + "`";

I am also having same problem…
BackendlessUser currentUser = Backendless.UserService.CurrentUser();
BackendlessDataQuery dataQuery = new BackendlessDataQuery();
dataQuery.setWhereClause( “email.ObjectId=”+currentUser.getObjectId());

Its a relation column but still i am getting error as Server reported an error - Invalid where clause
Kindly help