From 3a6a83298adf11ec89180ebb244c22d25784f9d4 Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 13:59:26 -0300 Subject: [PATCH 01/17] Add missing word "as" --- source/applications/aggregation.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index ce5d3f65edf..42aaa4fdd3a 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -42,7 +42,7 @@ Pipelines ~~~~~~~~~ Conceptually, documents from a collection pass through an -aggregation pipeline, which transforms these objects they pass through. +aggregation pipeline, which transforms these objects as they pass through. For those familiar with UNIX-like shells (e.g. bash,) the concept is analogous to the pipe (i.e. ``|``) used to string text filters together. From 197f9fac7066915bde1889b37bac8a420812d2f5 Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:02:58 -0300 Subject: [PATCH 02/17] Remove extra "reference" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove word "reference" which is after “Aggregation Framework Reference” when rendered. --- source/applications/aggregation.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index 42aaa4fdd3a..dc31347aadd 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -66,7 +66,7 @@ through the pipeline. .. include:: /includes/warning-aggregation-types.rst -.. seealso:: The ":doc:`/reference/aggregation`" reference includes +.. seealso:: The ":doc:`/reference/aggregation`" includes documentation of the following pipeline operators: - :agg:pipeline:`$project` From 07e73c7fe1904e83dc496a10ae9bb44f8c3653fb Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:04:23 -0300 Subject: [PATCH 03/17] Pluralization --- source/applications/aggregation.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index dc31347aadd..2316e75ec94 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -83,7 +83,7 @@ Expressions ~~~~~~~~~~~ :ref:`Expressions ` produce output -document based on calculations performed on input documents. The +documents based on calculations performed on input documents. The aggregation framework defines expressions using a document format using prefixes. From 765461530892e69eeea8808d01e1b65964a06d08 Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:05:39 -0300 Subject: [PATCH 04/17] Remove spurious comma --- source/applications/aggregation.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index 2316e75ec94..f640d597f59 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -89,7 +89,7 @@ using prefixes. Expressions are stateless and are only evaluated when seen by the aggregation process. All aggregation expressions can only operate on -the current document, in the pipeline, and cannot integrate data from +the current document in the pipeline, and cannot integrate data from other documents. The :term:`accumulator` expressions used in the :agg:pipeline:`$group` From dbde0bdf1af8ec19b76d026d77c538b4fc861576 Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:08:17 -0300 Subject: [PATCH 05/17] Replace "to" with "of" --- source/applications/aggregation.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index f640d597f59..a6e5393bc19 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -109,7 +109,7 @@ Invocation Invoke an :term:`aggregation` operation with the :method:`aggregate() ` wrapper in the :program:`mongo` shell or the :dbcommand:`aggregate` :term:`database command`. Always call :method:`aggregate() ` on a -collection object that determines the input documents to the aggregation :term:`pipeline`. +collection object that determines the input documents of the aggregation :term:`pipeline`. The arguments to the :method:`aggregate() ` function specifies a sequence of :ref:`pipeline operators `, where each operator may have a number of operands. From fa41ff817a21a874c81a4037493c93fc9127ae38 Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:09:13 -0300 Subject: [PATCH 06/17] Change "specifies" to "specify" --- source/applications/aggregation.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index a6e5393bc19..dca89c29533 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -110,7 +110,7 @@ Invoke an :term:`aggregation` operation with the :method:`aggregate() ` on a collection object that determines the input documents of the aggregation :term:`pipeline`. -The arguments to the :method:`aggregate() ` function specifies a sequence of :ref:`pipeline +The arguments to the :method:`aggregate() ` function specify a sequence of :ref:`pipeline operators `, where each operator may have a number of operands. From c889cf9ffe7cf20d382355bed74e2b14bd2a1d76 Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:12:48 -0300 Subject: [PATCH 07/17] Improve phrasing --- source/applications/aggregation.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index dca89c29533..ac07b65059e 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -152,10 +152,10 @@ command: ); The aggregation pipeline begins with the :term:`collection` -``article`` and selects the ``author`` and ``tags`` fields using the -:agg:pipeline:`$project` aggregation operator, and runs the -:agg:expression:`$unwind` operator to produce one output document per -tag finally uses the :agg:expression:`$group` operator on these fields +``articles`` and selects the ``author`` and ``tags`` fields using the +:agg:pipeline:`$project` aggregation operator. The +:agg:expression:`$unwind` operator is used to produce one output document per +tag. Finally, the :agg:expression:`$group` operator is used on these fields to pivot the data. Result From dd28894f71857fbcb2b86c4bb36950004614581f Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:14:34 -0300 Subject: [PATCH 08/17] Improve sentence clarity --- source/applications/aggregation.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index ac07b65059e..d38c6669fad 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -169,8 +169,8 @@ The aggregation operation in the previous section returns a - ``ok`` which holds the value ``1``, indicating success, or another value if there was an error -As a document, the result is subject to the current :ref:`BSON -Document size `, which is 16 megabytes. +As a document, the result is subject to the :ref:`BSON +Document size ` limit, which is currently 16 megabytes. Optimizing Performance ---------------------- From a022445e4d83217adf4cddc206a9f95e8878fdf4 Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:15:55 -0300 Subject: [PATCH 09/17] Add missing word "operator" --- source/applications/aggregation.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index d38c6669fad..9883d429a16 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -184,7 +184,7 @@ the aggregation pipeline, you may want to optimize the operation by avoiding scanning the entire collection whenever possible. If your aggregation operation requires only a subset of the data in a -collection, use the :agg:pipeline:`$match` to restrict which items go +collection, use the :agg:pipeline:`$match` operator to restrict which items go in to the top of the pipeline, as in a query. When placed early in a pipeline, these :agg:pipeline:`$match` operations use suitable indexes to scan only the matching documents in a collection. From fdf2ab8d6508b32c461a62947274ecf64825c009 Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:17:19 -0300 Subject: [PATCH 10/17] Fix typo, improve wording --- source/applications/aggregation.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index 9883d429a16..a1866024ad4 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -201,7 +201,7 @@ to scan only the matching documents in a collection. .. without affecting the result by moving the :agg:pipeline:`$match` .. operator in front of the :agg:pipeline:`$project`. -In future versions there may be pipleine optimization phase in the +In future versions there may be an optimization phase in the pipleine that reorders the operations to increase performance without affecting the result. However, at this time place :agg:pipeline:`$match` operators at the beginning of the pipeline when From a67dd3a561b7ca0909eff73d18cbf712f3c8a797 Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:19:03 -0300 Subject: [PATCH 11/17] Replace "for" with "in" --- source/applications/aggregation.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index a1866024ad4..9c46baaec3f 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -220,7 +220,7 @@ must fit in memory. :agg:pipeline:`$group` has similar characteristics: Before any :agg:pipeline:`$group` passes its output along the pipeline, it must -receive the entirety of its input. For the case of :agg:pipeline:`$group` +receive the entirety of its input. In the case of :agg:pipeline:`$group` this frequently does not require as much memory as :agg:pipeline:`$sort`, because it only needs to retain one record for each unique key in the grouping specification. From 4827333e0353983dd939af39e550028661909e07 Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:19:59 -0300 Subject: [PATCH 12/17] Remove spurious "the" --- source/applications/aggregation.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index 9c46baaec3f..e85a2dbe8cb 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -237,7 +237,7 @@ Sharded Operation .. versionchanged:: 2.1 - Some aggregation operations using the :dbcommand:`aggregate` will + Some aggregation operations using :dbcommand:`aggregate` will cause :program:`mongos` instances to require more CPU resources than in previous versions. This modified performance profile may dictate alternate architecture decisions if you make use the From 319f02ce7a946c969423fa7e9a8693873aa22915 Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:22:21 -0300 Subject: [PATCH 13/17] Add missing "of", change "architecture" to "architectural" --- source/applications/aggregation.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index e85a2dbe8cb..26678322707 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -240,7 +240,7 @@ Sharded Operation Some aggregation operations using :dbcommand:`aggregate` will cause :program:`mongos` instances to require more CPU resources than in previous versions. This modified performance profile may - dictate alternate architecture decisions if you make use the + dictate alternate architectural decisions if you make use of the :term:`aggregation framework` extensively in a sharded environment. The aggregation framework is compatible with sharded collections. From 0b9127eb11ed777a5f82028ee0fd4289ab52ac6a Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:23:03 -0300 Subject: [PATCH 14/17] Improve phrasing --- source/applications/aggregation.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index 26678322707..c1d5e293474 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -246,7 +246,7 @@ Sharded Operation The aggregation framework is compatible with sharded collections. When operating on a sharded collection, the aggregation pipeline -splits the pipeline into two parts. The aggregation framework pushes +is split into two parts. The aggregation framework pushes all of the operators up to and including the first :agg:pipeline:`$group` or :agg:pipeline:`$sort` to each shard. [#match-sharding]_ Then, a second pipeline on the :program:`mongos` From a5f921267b0cdcda9fd269136f37af4e213ab827 Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:24:49 -0300 Subject: [PATCH 15/17] Improve sentence structure --- source/applications/aggregation.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index c1d5e293474..f43a1c09868 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -251,8 +251,8 @@ all of the operators up to and including the first :agg:pipeline:`$group` or :agg:pipeline:`$sort` to each shard. [#match-sharding]_ Then, a second pipeline on the :program:`mongos` runs. This pipeline consists of the first :agg:pipeline:`$group` or -:agg:pipeline:`$sort` and any remaining pipeline operators: this -pipeline runs on the results received from the shards. +:agg:pipeline:`$sort` and any remaining pipeline operators, and runs +on the results received from the shards. The :program:`mongos` pipeline merges :agg:pipeline:`$sort` operations from the shards. The :agg:pipeline:`$group`, brings any “sub-totals” From a8aff728c444b297233e86d8697a4cac68dcccde Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:27:03 -0300 Subject: [PATCH 16/17] Improve sentence structure --- source/applications/aggregation.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index f43a1c09868..046e97244e6 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -255,10 +255,10 @@ runs. This pipeline consists of the first :agg:pipeline:`$group` or on the results received from the shards. The :program:`mongos` pipeline merges :agg:pipeline:`$sort` operations -from the shards. The :agg:pipeline:`$group`, brings any “sub-totals” +from the shards. The :agg:pipeline:`$group` operation brings in any “sub-totals” from the shards and combines them: in some cases these may be structures. For example, the :agg:expression:`$avg` expression maintains a -total and count for each shard; the :program:`mongos` combines these +total and count for each shard; :program:`mongos` combines these values and then divides. .. [#match-sharding] If an early :agg:pipeline:`$match` can exclude From 12da498df3d65e39337019e4e964324e74ef9d32 Mon Sep 17 00:00:00 2001 From: Matt Hurne Date: Thu, 30 Aug 2012 14:28:24 -0300 Subject: [PATCH 17/17] Add missing word "command", remove unnecessary comma --- source/applications/aggregation.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/applications/aggregation.txt b/source/applications/aggregation.txt index 046e97244e6..ade29349488 100644 --- a/source/applications/aggregation.txt +++ b/source/applications/aggregation.txt @@ -277,7 +277,7 @@ the following limitations: - Output from the :term:`pipeline` can only contain 16 megabytes. If your result set exceeds this limit, the :dbcommand:`aggregate` - produces an error. + command produces an error. - If any single aggregation operation consumes more than 10 percent of - system RAM, the operation will produce an error. + system RAM the operation will produce an error.