title: What is the correct query for a Doctrine ODM Geospatial query?
body: <p>I've set up a classes as described at<br>
  <a href="http://www.doctrine-project.org/docs/mongodb_odm/1.0/en/reference/geospatial-queries.html" rel="nofollow">http://www.doctrine-project.org/docs/mongodb_odm/1.0/en/reference/geospatial-queries.html</a></p>
  
  <p>My 2d index is set correctly in mongo</p>
  
  <pre><code>&gt; db.system.indexes.find()                                          
  { "v" : 1, "key" : { "_id" : 1 }, "ns" : "pfcd_dev.media", "name" : "_id_" }
  { "v" : 1, "key" : { "_id" : 1 }, "ns" : "pfcd_dev.events", "name" : "_id_" }
  { "v" : 1, "key" : { "coordinates" : "2d" }, "ns" : "pfcd_dev.events", "name" : "coordinates_" }
  </code></pre>
  
  <p>When I run the following command on the mongo shell, I get numerous results returned.</p>
  
  <pre><code>db.runCommand( { geoNear : "events" , near : [50,60], num : 10 } )
  </code></pre>
  
  <p>I've tried all the following variations for <code>near()</code>, all return zero results</p>
  
  <pre><code>$places = $this-&gt;dm-&gt;createQueryBuilder('\Application\Event')-&gt;field('coordinates')-&gt;near('[50,60]')-&gt;getQuery()-&gt;execute();
  $places = $this-&gt;dm-&gt;createQueryBuilder('\Application\Event')-&gt;field('coordinates')-&gt;near('50,60')-&gt;getQuery()-&gt;execute();
  $places = $this-&gt;dm-&gt;createQueryBuilder('\Application\Event')-&gt;field('coordinates')-&gt;near(50,60)-&gt;getQuery()-&gt;execute();
  $places = $this-&gt;dm-&gt;createQueryBuilder('\Application\Event')-&gt;field('coordinates')-&gt;near(array(50,60))-&gt;getQuery()-&gt;execute();
  </code></pre>
  
  <p>The documentation on Doctrine's site seems to be a bit off. Just for record, I've created a gist showing my classes (trucated). <a href="https://gist.github.com/1627491" rel="nofollow">https://gist.github.com/1627491</a></p>
  
  <p>This is the output of <code>debug()</code></p>
  
  <pre><code>$this-&gt;dm-&gt;createQueryBuilder('\Application\Event')-&gt;field('coordinates')-&gt;near('50,60')-&gt;debug();
  
      Array
      (
          [type] =&gt; 10
          [mapReduce] =&gt; Array
              (
                  [map] =&gt; 
                  [reduce] =&gt; 
                  [options] =&gt; Array
                      (
                      )
  
              )
  
          [near] =&gt; Array
              (
                  [coordinates] =&gt; 50,60
              )
  
      )
  </code></pre>