title: Mongotemplate - Query ObjectId according to greater than (gt) or less than (lt) operator
body: <p>When I type this into my consol, it works:</p>
  
  <pre><code>db.posts.find({"_id": {$lt:ObjectId("55732dccf58c555b6d3f1c5a")}}).limit(5).sort({"_id":-1})
  </code></pre>
  
  <p>When I use mongotemplate, it doesn't work and returns a blank array:</p>
  
  <pre><code>  @RequestMapping(value="/next", method=RequestMethod.GET)
    public List getNextPost(@RequestParam String next) {
        Query query = new Query();
        query.addCriteria(Criteria.where("_id").lt("55732dccf58c555b6d3f1c5a"));
        List&lt;Posts&gt; posts = template.find(query, Posts.class);
        return posts;
  
    }
  </code></pre>
  
  <p>I tried it with this query instead and it works but only returns the specific entry related to the id:</p>
  
  <pre><code>query.addCriteria(Criteria.where("_id").is("55732dccf58c555b6d3f1c5a"));
  </code></pre>
  
  <p>I also tried with Basic Query and did this and it also returns a blank array:</p>
  
  <pre><code>BasicQuery query1 = new BasicQuery("{'_id': {$lt:'ObjectId(\"55732dccf58c555b6d3f1c5a\")'}}).limit(5).sort({'_id':-1}");
  </code></pre>
  
  <p>I'm stumped. How do I return all the docs below a certain Mongo ObjectID in a database?</p>