title: Validate data from MongoDB using java
body: <p>I am fetching data from MongoDB using java program. MongoDB data contains:</p>
  
  <pre><code>{
  "gender": "female",
  "city": "ABC",
  "phone": "+1 (995) 441-2988",
  "email": "undefined.undefined@.info",
  "date": "2015-08-11T15:55:00 -06:-30",
  "age": 37,}
  </code></pre>
  
  <p>Need to validate data like city should be string value, age should be integer, etc. Is there any quick way to use MongoDB queries in java to validate this?</p>