A few doctest fixes.
This commit is contained in:
parent
1dbc90d07b
commit
fccd213a2c
@ -67,8 +67,8 @@ It's also possible to query for all items within a given rectangle
|
||||
>>> for doc in db.places.find({"loc": {"$within": {"$box": [[2, 2], [5, 6]]}}}):
|
||||
... repr(doc)
|
||||
...
|
||||
"{u'loc': [4, 4], u'_id': ObjectId('...')}"
|
||||
"{u'loc': [2, 5], u'_id': ObjectId('...')}"
|
||||
"{u'loc': [4, 4], u'_id': ObjectId('...')}"
|
||||
|
||||
Or circle (specified by center point and radius):
|
||||
|
||||
@ -87,4 +87,5 @@ geoNear queries are also supported using :class:`~bson.son.SON`:
|
||||
|
||||
>>> from bson.son import SON
|
||||
>>> db.command(SON([('geoNear', 'places'), ('near', [1, 2])]))
|
||||
{u'ok': 1.0, u'near': u'1100000000000001100111100111100000000001100111100111', u'ns': u'geo_example.places', u'stats': ...}
|
||||
|
||||
|
||||
@ -69,10 +69,8 @@ I'm saving ``9.99`` but when I query my document contains ``9.9900000000000002``
|
||||
The database representation is ``9.99`` as an IEEE floating point (which
|
||||
is common to MongoDB and Python as well as most other modern
|
||||
languages). The problem is that ``9.99`` cannot be represented exactly
|
||||
with a double precision floating point - this is true in Python as
|
||||
well:
|
||||
|
||||
.. doctest::
|
||||
with a double precision floating point - this is true in some versions of
|
||||
Python as well:
|
||||
|
||||
>>> 9.99
|
||||
9.9900000000000002
|
||||
|
||||
Loading…
Reference in New Issue
Block a user