In Swift, is it possible to create a whereClause that uses an array? There is a post on this forum that discusses using arrays in whereClauses but I am having trouble with the syntax. Here is what I would like to do.
let whereClauseArray = ["Jon", "Mike", "Chris", "Lindsay", "Jeffrey"]
let whereClause = "username in whereClauseArray"
let dataQuery = BackendlessDataQuery()
dataQuery.whereClause = whereClause
self.backendless?.data.of(BackendlessUser.ofClass()).find(dataQuery, response: {(result : BackendlessCollection?) -> () in
let currentUser = result?.data as! [BackendlessUser]
for user in currentUser
{
print(user)
}
}, error: {(fault : Fault?) -> () in
print("There is an error: \(fault)")
})
I know my trouble is here.
let whereClause = "username in whereClauseArray"
Is there a way to write this so that it compiles properly?