Skip to content

Commit 12cefd6

Browse files
zercbehackett
authored andcommitted
Small fix documentation aggregation
Updated the example of Grouping
1 parent 22cf7f2 commit 12cefd6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

doc/examples/aggregation.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,13 @@ reduce function.
174174
Here we are doing a simple group and count of the occurrences of ``x`` values:
175175

176176
.. doctest::
177-
177+
>>> from bson.code import Code
178178
>>> reducer = Code("""
179179
... function(obj, prev){
180180
... prev.count++;
181181
... }
182182
... """)
183183
...
184-
>>> from bson.son import SON
185184
>>> results = db.things.group(key={"x":1}, condition={}, initial={"count": 0}, reduce=reducer)
186185
>>> for doc in results:
187186
... print doc

0 commit comments

Comments
 (0)