title: Realm: combine "or" and "and"
body: <p>I am looking for a way to combine a AND and OR in a Realm Query.</p>
  
  <p>This is my class:</p>
  
  <pre><code>class Event extends RealmObject {
     String id;
     String date;
  }
  </code></pre>
  
  <p>Now, I have is a list of <code>id</code>s, and I want to retrieve <code>Event</code>s with ids {1, 4, 5} and <code>date = "2016-01-01"</code>. In SQL I would have a query like: <code>WHERE id IN ids AND date = 'mydate'</code></p>
  
  <p>What I've tried so far:</p>
  
  <pre><code>RealmQuery&lt;Event&gt; query = realm.where(Event.class);
  
  for(String id : ids) {
     query = query.or().equalTo("id", id);
  }
  
  query.equalTo("date", "2016-01-01");
  </code></pre>
  
  <p>But it won't work that way. How can I do this in Realm?</p>