Skip to content

Commit 4080a31

Browse files
author
Mike Dirolf
committed
update docs
1 parent a5e05a5 commit 4080a31

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

doc/examples/map_reduce.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ PyMongo's API supports all of the features of MongoDB's map/reduce engine. One i
8989
.. doctest::
9090

9191
>>> db.things.map_reduce(map, reduce, full_response=True)
92-
{u'counts': {u'input': 4, u'emit': 6, u'output': 3}, u'timeMillis': ..., u'ok': True, u'result': u'...'}
92+
{u'counts': {u'input': 4, u'emit': 6, u'output': 3}, u'timeMillis': ..., u'ok': ..., u'result': u'...'}
9393

9494
All of the optional map/reduce parameters are also supported, simply pass them as keyword arguments. In this example we use the `query` parameter to limit the documents that will be mapped over:
9595

doc/tutorial.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ document in the ``posts`` collection:
226226
... post
227227
...
228228
{u'date': datetime.datetime(...), u'text': u'My first blog post!', u'_id': ObjectId('...'), u'author': u'Mike', u'tags': [u'mongodb', u'python', u'pymongo']}
229-
{u'date': datetime.datetime(2009, 11, 12, 11, 14, tzinfo=...), u'text': u'Another post!', u'_id': ObjectId('...'), u'author': u'Mike', u'tags': [u'bulk', u'insert']}
230-
{u'date': datetime.datetime(2009, 11, 10, 10, 45, tzinfo=...), u'text': u'and pretty easy too!', u'_id': ObjectId('...'), u'author': u'Eliot', u'title': u'MongoDB is fun'}
229+
{u'date': datetime.datetime(2009, 11, 12, 11, 14), u'text': u'Another post!', u'_id': ObjectId('...'), u'author': u'Mike', u'tags': [u'bulk', u'insert']}
230+
{u'date': datetime.datetime(2009, 11, 10, 10, 45), u'text': u'and pretty easy too!', u'_id': ObjectId('...'), u'author': u'Eliot', u'title': u'MongoDB is fun'}
231231

232232
Just like we did with :meth:`~pymongo.collection.Collection.find_one`,
233233
we can pass a document to :meth:`~pymongo.collection.Collection.find`
@@ -240,7 +240,7 @@ author is "Mike":
240240
... post
241241
...
242242
{u'date': datetime.datetime(...), u'text': u'My first blog post!', u'_id': ObjectId('...'), u'author': u'Mike', u'tags': [u'mongodb', u'python', u'pymongo']}
243-
{u'date': datetime.datetime(2009, 11, 12, 11, 14, tzinfo=...), u'text': u'Another post!', u'_id': ObjectId('...'), u'author': u'Mike', u'tags': [u'bulk', u'insert']}
243+
{u'date': datetime.datetime(2009, 11, 12, 11, 14), u'text': u'Another post!', u'_id': ObjectId('...'), u'author': u'Mike', u'tags': [u'bulk', u'insert']}
244244

245245
Counting
246246
--------
@@ -274,8 +274,8 @@ than a certain date, but also sort the results by author:
274274
>>> for post in posts.find({"date": {"$lt": d}}).sort("author"):
275275
... post
276276
...
277-
{u'date': datetime.datetime(2009, 11, 10, 10, 45, tzinfo=...), u'text': u'and pretty easy too!', u'_id': ObjectId('...'), u'author': u'Eliot', u'title': u'MongoDB is fun'}
278-
{u'date': datetime.datetime(2009, 11, 12, 11, 14, tzinfo=...), u'text': u'Another post!', u'_id': ObjectId('...'), u'author': u'Mike', u'tags': [u'bulk', u'insert']}
277+
{u'date': datetime.datetime(2009, 11, 10, 10, 45), u'text': u'and pretty easy too!', u'_id': ObjectId('...'), u'author': u'Eliot', u'title': u'MongoDB is fun'}
278+
{u'date': datetime.datetime(2009, 11, 12, 11, 14), u'text': u'Another post!', u'_id': ObjectId('...'), u'author': u'Mike', u'tags': [u'bulk', u'insert']}
279279

280280
Here we use the special ``"$lt"`` operator to do a range query, and
281281
also call :meth:`~pymongo.cursor.Cursor.sort` to sort the results

0 commit comments

Comments
 (0)