title: MongoDB geospatial search by zip
body: <p>I'm using MongoDB to do some geospatial queries.  My zipcode collection looks like this:</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>{
    _id: "60661",
    city: "CHICAGO",
    state: "IL",
    loc: [
          -87.68,
          41.83
         ]
  }
  </code></pre>
  
  <p>After adding my 2d index, I can run the following query successfully:</p>
  
  <pre class="lang-js prettyprint-override"><code>db.zipcodes.find({ loc: { $near: [ -87.68, 41.83 ], $maxDistance: 5*(1/69) } })
  </code></pre>
  
  <p>This returns all zipcodes within 5 miles of the lon/lat coordinates sent.</p>
  
  <p>How would I go about sending in a zipcode, instead of a lon/lat position?  Like so:</p>
  
  <pre class="lang-js prettyprint-override"><code>db.zipcodes.find({ loc: { $near: "60661", $maxDistance: 5*(1/69) } })
  </code></pre>
  
  <p>Thanks!</p>