title: Due to limitations of the com.mongodb.BasicDBObject exception when add multiple criteria GridFSDBFile query
body: <p>I want add multiple criteria in GridFSDBFile, I have iterated the map and formed the criteria object but i am getting following exception </p>
  
  <blockquote>
    <p>Due to limitations of the com.mongodb.BasicDBObject, you can't add a
    second '$and' expression specified.</p>
  </blockquote>
  
  <p>My code snippet is  </p>
  
  <pre><code>public void getFile(Map&lt;String, Object&gt; metaData) throws Exception {
      Criteria criteria = new Criteria();
      metaData.forEach((k, v) -&gt; criteria.andOperator(Criteria.where("metadata." + k).is(v)));
      GridFSDBFile gridFSDBFile = gridFsOperations.findOne(new Query(criteria));
      if (gridFSDBFile == null) {
          throw new HttpConflictException();
  }
  </code></pre>