title: mongodb mongoTemplate get distinct field with some criteria
body: <p>My MongoDB json structure is</p>
  
  <pre><code> {
      "_id" : "122134231234234",
      "name" : "Total_pop",
      "description" : "sales category",
      "source" : "public",
      "dataset" :"d1"
  
  
  },
  {
      "_id" : "1123421231234234",
      "name" : "Total_pop",
      "description" : "sales category",
      "source" : "public",
      "dataset" :"d1"
  
  
  },
  {
      "_id" : "12312342332423343",
      "name" : "Total_pop",
      "description" : "sales category",
      "source" : "private",
      "description" : "d1"
  }
  </code></pre>
  
  <p>I need to get collection distinct of dataset where source is public.
  I tried this query, and it didn't work:</p>
  
  <pre><code>Criteria criteria = new Criteria();
  criteria.where("source").in("public");     
  query.addCriteria(criteria);
  query.fields().include("name");
  query.fields().include("description");
  query.fields().include("description");
  query.fields().include("source"); List list =
  mongoTemplate.getCollection("collectionname").distinct("source", query);
  </code></pre>
  
  <p>Can you please help me out?</p>