title: Querying MongoDB Embedded Array
body: <p>I am having some trouble trying to query a field in Mongo. My document looks like this:</p>
  
  <pre><code>{
      "short_url": "DTsB9k",
      "long_url": "http://www.example.com",
      "date_created": {
          "$date": "2013-01-01T14:10:29.899Z"
      },
      "ips": {
          "24.184.209.227": {
              "ip_address": "12.34.56.78",
              "clicks": [
                  {
                      "click_date": {
                          "$date": "2013-01-01T14:10:41.784Z"
                      },
                      "click_referrer": null
                  },
                  {
                      "click_date": {
                          "$date": "2013-01-01T14:31:32.440Z"
                      },
                      "click_referrer": null
                  }
              ]
          }
      },
      "users": {
          "4": {
              "user_id": "4",
              "date_added": {
                  "$date": "2013-01-01T14:10:29.899Z"
              },
              "creator": true
          }
      },
      "total_clicks": 2,
      "_id": {
          "$oid": "50e2ee55569df0b469000000"
      }
  }
  </code></pre>
  
  <p>I'm trying to query on the user_id, eventually there will be more than one. But I've tried</p>
  
  <pre><code>{ "users" : "4" }
  { "users.user_id" : "4" }
  { "users.*.user_id" : "4" }
  </code></pre>
  
  <p>None of these work. What am I doing wrong in this?</p>