title: Querying and Updating different documents in MongoDB
body: <p>I am new to MongoDB so please excuse my ignorance.</p>
  
  <p>I have a mongoDB which contains a bunch of documents with something like this</p>
  
  <pre><code>["field": "blah", "version":"1" ...]
  ["field": "blah", "version":"2" ...]
  ["field": "blah", "version":"1"....]
  ["field": "blah1", "version":"10"...]
  ["field": "blah2", "version":"100"...]
  ["field": "blah3", "version":"1"....]
  ["field": "blah3", "version":"2"....]
  ["field": "blah2", "version":"1"....
  </code></pre>
  
  <p>I am trying to send a list of queries and fetch all the records as a batch. Is it possible to do so? </p>
  
  <pre><code>List&lt;Docs&gt; fetchDocs(Map&lt;String, String&gt; queries)
  {
       CriteriaContainer cc=null;
       Query&lt;Docs&gt; query = this.mongoDao.createQuery(MyClass.class);
       for (Map.Entry&lt;String,String &gt;entry : queries.entrySet())
       {
            if(cc ==null)
            {
              cc= query.criteria("Field").equal(entry.getKey()).and(query.criteria("version").equal(entry.getValue()));
            }
            else
            {
              cc.or(query.criteria("Field").equal(entry.getKey()).and(query.criteria("version").equal(entry.getValue()));)
            }
  
      }
      query.and(cc);
      List&lt;Docs&gt; doc = query.asList();
  
      return doc;
  }
  </code></pre>
  
  <p>I am not geting the correct list back.  I am not sure if I have written this query correctly.</p>
  
  <p>essentially, I want to fetch results or query like this</p>
  
  <pre><code>[{"Field":"blah,"version":1 } $or {"Field":"blah1", "version":10} ]
  </code></pre>
  
  <p>It should return me a list containing </p>
  
  <pre><code>["field": "blah", "version":"1" ....]
  
  ["field": "blah1", "version":"10"....]
  </code></pre>