title: Mongo in Node.js: Can't canonicalize query: BadValue geoNear must be top-level expr
body: <p>I've got a geometry-based query here that is nested within an $or and combined with the $and operators. </p>
  
  <p>Mongo keeps throwing the following error: </p>
  
  <pre><code> MongoError: Can't canonicalize query: BadValue geoNear must be top-level expr
  </code></pre>
  
  <p>I'm using the native Mongo node driver vs 1.4.3. I see a similar bug posted <a href="https://jira.mongodb.org/browse/SERVER-12440" rel="nofollow">here</a>.</p>
  
  <p>Is this a case of me building the query wrong, or should I file a bug with Mongo?</p>
  
  <pre><code>{
      "$or": [
          {
              "$and": [
                  {
                      "startDate": {
                          "$gt": "2013-12-27T08:00:00.000Z"
                      }
                  },
                  {
                      "startDate": {
                          "$lt": "2013-02-08T08:00:00.000Z"
                      }
                  },
                  {
                      "loc": {
                          "$near": {
                              "$geometry": {
                                  "type": "Point",
                                  "coordinates": [
                                      123.3423,
                                      22.2131
                                  ]
                              },
                              "$maxDistance": 4
                          }
                      }
                  }
              ]
          },
          {
              "$and": [
                  {
                      "startDate": {
                          "$gt": "2013-12-27T08:00:00.000Z"
                      }
                  },
                  {
                      "startDate": {
                          "$lt": "2013-02-08T08:00:00.000Z"
                      }
                  }
              ]
          }
      ]
  }
  </code></pre>