title: How to return raw JSON directly from a mongodb query in Java?
body: <p>I have the following code:</p>
  
  <pre><code>@RequestMapping(value = "/envinfo", method = RequestMethod.GET)
  @ResponseBody
  public Map getEnvInfo()
  {
      BasicQuery basicQuery = new BasicQuery("{_id:'51a29f6413dc992c24e0283e'}", "{'envinfo':1, '_id': false }");
      Map envinfo= mongoTemplate.findOne(basicQuery, Map.class, "jvmInfo");
      return envinfo;
  }
  </code></pre>
  
  <p>As you can notice, the code:</p>
  
  <ol>
  <li>Retrieves JSON from MongoDB</li>
  <li>Converts it to a <code>Map</code> object</li>
  <li>The <code>Map</code> object is then converted to JSON by Spring MongoData before it is returned to the browser.</li>
  </ol>
  
  <p>Is it possible to directly return the raw json from MongoDb without going through the intermediate conversion steps?</p>