title: MongoDB can't parse query (2dsphere): $geoWithin:
body: <p>I have the following objects in my Collection that look like the following:</p>
  
  <pre><code>{
      "_id" : ObjectId("527d33a8623f6efd1c997440"),
      "location" : {
          "geometry" : {
              "type" : "Point",
              "coordinates" : [ 
                  -78.4067, 
                  37.26725
              ]
          },
          "type" : "Feature",
          "properties" : {
              "name" : "Something here"
          }
      },
      "name" : "Name of Object"
  }
  </code></pre>
  
  <p>I have the following index:</p>
  
  <pre><code>{
      "location.geometry" : "2dsphere"
  }
  </code></pre>
  
  <p>I can do the following:</p>
  
  <pre><code> db.myCollection.find({'location.geometry':{'$near':{'$geometry':{'type':"Point", 'coordinates': [-78.406700,37.267250]}, '$maxDistance' : 1000 }}})
  </code></pre>
  
  <p>However, I can <strong>Not</strong> do the following:</p>
  
  <pre><code>db.myCollection.find( { 'location.geometry': { '$geoWithin': 
                                              { '$geometry' :
                                                  { 'type' : "Polygon", 
                                                    'coordinates' :  [ [ -118.108006, 34.046072], [ -117.978230, 34.041521] , [ -117.987328,33.913645 ]]  } }
                                           } } )
  </code></pre>
  
  <p>As it returns with the error:</p>
  
  <pre><code>error: {
      "$err" : "can't parse query (2dsphere): { $geoWithin: { $geometry: { type: \"Polygon\", coordinates: [ [ -118.108006, 34.046072 ], [ -117.97823, 34.041521 ], [ -117.987328, 33.913645 ] ] } } }",
      "code" : 16535
  }
  </code></pre>
  
  <p>Am I using geoWithin wrong?  Can it not be used on this index?</p>