From 21ceea4ab964159124a4ee05dfeb2d3d89134d64 Mon Sep 17 00:00:00 2001 From: behackett Date: Fri, 22 Jul 2011 10:07:54 -0700 Subject: [PATCH] Add a geoNear example. --- doc/examples/geo.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/examples/geo.rst b/doc/examples/geo.rst index bfa2aad692..a39c1efc6f 100644 --- a/doc/examples/geo.rst +++ b/doc/examples/geo.rst @@ -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])])) +