From 12cefd69c003930e2eefad3c5a72a5f75c7d5b81 Mon Sep 17 00:00:00 2001 From: Vladimir Savin Date: Sun, 19 Apr 2015 15:56:18 +0300 Subject: [PATCH] Small fix documentation aggregation Updated the example of Grouping --- doc/examples/aggregation.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/examples/aggregation.rst b/doc/examples/aggregation.rst index 32b1137a7..82af59c4c 100644 --- a/doc/examples/aggregation.rst +++ b/doc/examples/aggregation.rst @@ -174,14 +174,13 @@ reduce function. Here we are doing a simple group and count of the occurrences of ``x`` values: .. doctest:: - + >>> from bson.code import Code >>> reducer = Code(""" ... function(obj, prev){ ... prev.count++; ... } ... """) ... - >>> from bson.son import SON >>> results = db.things.group(key={"x":1}, condition={}, initial={"count": 0}, reduce=reducer) >>> for doc in results: ... print doc