Skip to content

Commit

Permalink
Add a geoNear example.
Browse files Browse the repository at this point in the history
  • Loading branch information
behackett committed Jul 22, 2011
1 parent d2f03c2 commit 21ceea4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/examples/geo.rst
Expand Up @@ -80,3 +80,11 @@ Or circle (specified by center point and radius):
"{u'loc': [1, 2], u'_id': ObjectId('...')}"
"{u'loc': [2, 5], u'_id': ObjectId('...')}"
"{u'loc': [4, 4], u'_id': ObjectId('...')}"

geoNear queries are also supported using :class:`~bson.son.SON`:

.. doctest::

>>> from bson.son import SON
>>> db.command(SON([('geoNear', 'places'), ('near', [1, 2])]))

0 comments on commit 21ceea4

Please sign in to comment.