title: Java RethinkDB Expected type DATUM but found SELECTION
body: <p>I'm using RethinkDB driver for Java. I want to filter the rows without field <code>endedAt</code> in table <code>jam</code> like this:</p>
  
  <pre><code>public List&lt;Jam&gt; getCurrent(){
          Cursor cursor = r.table("jam")
                  .filter(row -&gt; row.hasFields("endedAt")).not()
                  .run(conn);
          List&lt;Map&lt;String,Object&gt;&gt; list=cursor.toList();
          return list.stream().map(item-&gt;JamRepository.toJam(item)).collect(Collectors.toList());
      }
  </code></pre>
  
  <p>And I've got this error <code>Expected type DATUM but found SELECTION Java</code></p>
  
  <p>I have another filter function in another class:</p>
  
  <pre><code>public List&lt;Speedlog&gt; getByTime(long time){
          Cursor cursor = r.table("speedlog")
                  .filter(row -&gt; row.g("createdAt").eq(time))
                  .run(conn);
          List&lt;Map&lt;String,Object&gt;&gt; list=cursor.toList();
          return list.stream().map(item-&gt;SpeedlogRepository.toSpeedlog(item)).collect(Collectors.toList());
      }
  </code></pre>
  
  <p>This function works properly</p>
  
  <p>Could anyone please explain what makes the difference between these two? Why does <code>getCurrent</code> function get that error? What is its meaning and how to fix? Thank you</p>