Daniel
02/07/2024, 11:31 PMsuspend 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?Claus Rørbech
02/08/2024, 9:35 AMquery
as shown in this test, so you should be able to something like
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.