title: mongodb query by sub-field
body: <p>How to query all <code>{"module" : "B"}</code> ?</p>
  
  <p>The following query doesn't work:</p>
  
  <pre><code>db.XXX.find({ "_id" : { "module" : "B" } });
  </code></pre>
  
  <p>Thanks a ton!</p>
  
  <p>There data looks like:</p>
  
  <pre><code>{
    "_id" : {"module" : "A","date" : ISODate("2013-03-18T07:00:00Z")},
    "value" : {"count" : 1.0}
  }
  
  {
    "_id" : {"module" : "B","date" : ISODate("2013-03-18T08:00:00Z")},
    "value" : {"count" : 2.0}
  }
  </code></pre>