Question: Is is possible to do a "IN" query with Realm in android? I mean, doing the equivalent of "SELECT X FROM X WHERE x IN (...)?

Thank you very much in advance!

Answer: 
The official `IN` operator (since 1.2.0) works like this:

```
public RealmQuery<E> in(String fieldName, String[] values) {
    if (values == null || values.length == 0) {
        throw new IllegalArgumentException(EMPTY_VALUES);
    }
    beginGroup().equalTo(fieldName, values[0]);
    for (int i = 1; i < values.length; i++) {
        or().equalTo(fieldName, values[i]);
    }
    return endGroup();
}

```
In java:

```
RealmResults dogs = realm
             .where(Dog.class)
             .in("name", new String[] {"Larry","Curly","Moe"})
             .findAll();

```

In kotlin (note that `in` is a keyword so, check the syntax changes): 

```
val dogs = realm
     .where<Dog>()
     .`in`("name", arrayOf("Larry", "Curly", "Moe"))

```

Or 

```
val dogs = realm
     .where<Dog>()
     .anyOf("age", arrayOf("Larry", "Curly", "Moe"))

```