title: Mongodb dot notation wildcard?
body: <p>I have a collection of users, each of which may be subscribed to one or more services. Each service has some meta data, including the number of credits the user has for that service. </p>
  
  <p>How can I find all of the user objects who have less than 50 credits for some service if I have no way of knowing what the service objects keys will be?</p>
  
  <p>Conceptually, it would be something like this, which doesn't work: </p>
  
  <pre><code>db.users.find({services.*.credits : {$lt : 50}})
  </code></pre>
  
  <p>The users collection: </p>
  
  <pre><code>   {
  _id: 4f0ea25072139e4d2000001f,
  services : {
      a : { credits : 100, score : 2000 },
      b : { credits : 200, score : 300 },
      c : { credits : 10, score : 1300 }
      }
  },
  {
  _id: 4f0ea25072139e4d2000001f,
  services : {
      f : { credits : 68, score : 14 },
      q : { credits : 1000, score : 102 },
      z : { credits : 59, score : 352 }
      }
  }
  </code></pre>
  
  <p>Another example of what I want to do, in case it's not clear here, is explained here: <a href="http://www.mongodb.org/display/DOCS/Advanced+Queries#comment-346075854" rel="noreferrer">http://www.mongodb.org/display/DOCS/Advanced+Queries#comment-346075854</a></p>