title: How to find duplicate values in mongodb using distinct query?
body: <p>I am working on Mongodb distinct query, i have one collection with repeated entry, i am doing as per the created_at. But i want to fetch without repeated values.</p>
  
  <p>Sample JSON</p>
  
  <pre><code>{
    "posts": [{
        "id": "580a2eb915a0161010c2a562",
        "name": "\"Ah Me Joy\" Porter",
        "created_at": "15-10-2016"
      }, {
        "id": "580a2eb915a0161010c2a562",
        "name": "\"Ah Me Joy\" Porter",
        "created_at": "25-10-2016"
      }, {
        "id": "580a2eb915a0161010c2a562",
        "name": "\"Ah Me Joy\" Porter",
        "created_at": "01-10-2016"
      }, {
        "id": "580a2eb915a0161010c2bf572",
        "name": "Hello All",
        "created_at": "05-10-2016"
     }]
  }
  </code></pre>
  
  <p>Mongodb Query</p>
  
  <pre><code>db.getCollection('posts').find({"id" : ObjectId("580a2eb915a0161010c2a562")})
  </code></pre>
  
  <p>So i want to know about distinct query of mongodb, please kindly go through my post and let me know.</p>