Hello, IN operator does not work for realm query: ...
# realm
d
Hello, IN operator does not work for realm query:
Copy code
suspend fun getRestaurantsProcessedOrdersWithThrowAndroid(): CommonFlow<List<ProcessedOrder>> {
        realm.syncSession.downloadAllServerChanges()

        val userId = appService.currentUser

        if(appService.currentUser != null) {
            val restaurantsIds = realm.query<Restaurant>("userID = $0", userId!!.id).find().map { it.getID() }
            val queryValues = restaurantsIds.joinToString(separator = ",", prefix = "{", postfix = "}")
            return realm.query<ProcessedOrder>(
                "restaurantID IN $0", queryValues
            ).asFlow()
                 .map {
                     it.list
                 }.asCommonFlow()
        }
        else{
            throw Exception("user not logged in")
        }

    }
I have tried with listOf("id,"id","id")... Do you know why?
c
You should be able to pass the list of strings directly to
query
as shown in this test, so you should be able to something like
Copy code
realm.query<ProcessedOrder>("restaurantID IN $0", restaurantsIds)
If that doesn't work, please narrow it down the the smallest example showing your issue with model details, etc. and file an issue on the repository.