Kingdom Request Can I Use IN?

I have the following realm request, but from reading the documentation, I see no way to make an IN request.

I need to find the identifier in a string or array containing that identifier. Is it possible?

Code example:

Realm realmThread = Realm.getInstance(visnetawrap.appModel); RealmResults<PropertyObject> propResults = realmThread.where(PropertyObject.class).contains("propertyID", "(5,7,10)").findAll(); 
+8
android realm
source share
1 answer

I'm afraid I'm pointing out the obvious, but you can bind or ed equalTo s.

 RealmQuery<PropertyObject> query = realm.where(PropertyObject.class); query.beginGroup(); for(int i = 0; i < propertyIDs.length - 1; i++) { query.equalTo("propertyID", propertyIDs[i]).or(); } query.equalTo("propertyID", propertyIDs[propertyIDs.length - 1]).endGroup(); RealmResults<PropertyObject> propResults = query.findAll(); 
+2
source share

All Articles