Hi! I am trying to create a flexible sync subscription in Realm Swift to subscribe to all Items where the owner_id is either the user.id or a GLOBAL_ID.
subs.append(QuerySubscription<Item>(name: String(describing: Item.self)) {
$0.owner_id.in([user.id, GLOBAL_ID])
})
I always get the error: Received QUERY_ERROR “Client provided query with bad syntax: the indexed queryable field must be ANDed with the remainder of the query”
It seems like under the hood the query string is always converted to (owner_id == ‘user_id_string’ or owner_id == GLOBAL_ID), even if I use the IN keyword. I understand that using OR in a query on an indexed queryable field is not supported, but I thought that using IN was an acceptable substitute?
I’ve also tried creating a NSPredicate string, and appending two separate subscriptions to the set, but nothing’s worked.
This same query (using IN, not OR) works fine on my Node.js client. Is there any way to get this to work in Swift or is it a limitation of the SDK?