title: MongoDB Spring Data Hashmap query search for numeric key
body: <p>The following json data is a part of a document:</p>
  
  <pre><code>"ahashMap" : {
      "1" : {
          "type" : "STOCK"
      }
  }
  </code></pre>
  
  <p>To query above document in MongoDB shell, simply execute the script below:</p>
  
  <pre><code>db.COLS.findOne({'aHashMap.1.type':'STOCK'})
  </code></pre>
  
  <p>Moreover, to query using Spring Data, it also works for the below codes:</p>
  
  <pre><code>    Query q = new Query(Criteria.where("aHashMap.1.type").is("STOCK"));
      Col c = mongoOperation.findOne(q, Col.class);
  </code></pre>
  
  <p>However, it only works for older version of Spring Data, such as 1.7.0. Then I tried to compare the source code with old and new version. For the newest version such as 1.7.2, Spring Data removes the .digit from the query so no result would be found. It would treat as the below query for MongoDB:</p>
  
  <pre><code>db.COLS.findOne({'aHashMap.type':'STOCK'})
  </code></pre>
  
  <p>I feel confused for this kind of interpretation for Spring Data. Anyone would explain the reason behind and how would I process the query without restructure the document. Thank you.</p>