Skip to content

Commit 54997a9

Browse files
committed
rm feedback
1 parent c4e0e7e commit 54997a9

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

source/aggregation.txt

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -134,22 +134,22 @@ following stages:
134134
.. output::
135135
:visible: false
136136

137-
{"_id"=>"Missing", "count"=>51}
138-
{"_id"=>"Queens", "count"=>5656}
139-
{"_id"=>"Staten Island", "count"=>969}
140-
{"_id"=>"Brooklyn", "count"=>6086}
141-
{"_id"=>"Manhattan", "count"=>10259}
142-
{"_id"=>"Bronx", "count"=>2338}
137+
{"_id"=>"Bronx", "count"=>71}
138+
{"_id"=>"Manhattan", "count"=>221}
139+
{"_id"=>"Queens", "count"=>204}
140+
{"_id"=>"Missing", "count"=>2}
141+
{"_id"=>"Staten Island", "count"=>20}
142+
{"_id"=>"Brooklyn", "count"=>173}
143143

144144
Explain an Aggregation
145145
~~~~~~~~~~~~~~~~~~~~~~
146146

147147
To view information about how MongoDB executes your operation, you can instruct
148-
the MongoDB query planner to **explain** it. When MongoDB explains an operation,
149-
it returns **execution plans** and performance statistics. An execution plan is
150-
a potential way in which MongoDB can complete an operation. When you instruct
151-
MongoDB to explain an operation, it returns both the plan MongoDB executed and
152-
any rejected execution plans by default.
148+
the MongoDB :manual:`query planner </core/query-plans>` to **explain** it. When
149+
MongoDB explains an operation, it returns **execution plans** and performance
150+
statistics. An execution plan is a potential way in which MongoDB can complete
151+
an operation. When you instruct MongoDB to explain an operation, it returns both
152+
the plan MongoDB executed and any rejected execution plans by default.
153153

154154
To explain an aggregation operation, chain the ``explain`` method to the
155155
``aggregate`` method.
@@ -181,7 +181,7 @@ from the preceding :ref:`ruby-aggregation-example`:
181181
Run an Atlas Full-Text Search
182182
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183183

184-
.. tip:: Only Available on Atlas for MongoDB v4.2 and later
184+
.. note:: Only Available on Atlas for MongoDB v4.2 and later
185185

186186
This aggregation pipeline operator is only available for collections hosted
187187
on :atlas:`MongoDB Atlas </>` clusters running v4.2 or later that are
@@ -190,6 +190,14 @@ Run an Atlas Full-Text Search
190190
To specify a full-text search of one or more fields, you can create a
191191
``$search`` pipeline stage.
192192

193+
.. important::
194+
195+
To run the following example, you must create an Atlas Search index on the ``restaurants``
196+
collection that covers the ``name`` field. Then, replace the ``"<your_search_index_name>"``
197+
placeholder with the name of the index.
198+
199+
.. TODO: Add a link in the callout to the Atlas Search index creation guide.
200+
193201
This example creates pipeline stages to perform the following actions:
194202

195203
- Search the ``name`` field for the term ``"Salt"``
@@ -214,14 +222,6 @@ This example creates pipeline stages to perform the following actions:
214222
{"_id"=> {"$oid"=> "..."}, "name"=> "Salt And Fat"}
215223
{"_id"=> {"$oid"=> "..."}, "name"=> "Salt And Pepper Diner"}
216224

217-
.. important::
218-
219-
To run the preceding example, you must create an Atlas Search index on the ``restaurants``
220-
collection that covers the ``name`` field. Then, replace the ``"<search index name>"``
221-
placeholder with the name of the index.
222-
223-
.. TODO: Add a link in the callout to the Atlas Search index creation guide.
224-
225225
Additional Information
226226
----------------------
227227

source/includes/aggregation.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
gem 'mongo'
55
end
66

7-
uri = "<connection string URI>"
7+
uri = '<connection string URI>'
88

99
Mongo::Client.new(uri) do |client|
1010
#start-aggregation
1111
database = client.use('sample_restaurants')
1212
restaurants_collection = database[:restaurants]
1313

1414
pipeline = [
15+
{ '$match' => { 'cuisine' => 'Bakery' } },
1516
{ '$group' => {
1617
'_id' => '$borough',
1718
'count' => { '$sum' => 1 }
@@ -36,7 +37,7 @@
3637
search_pipeline = [
3738
{
3839
'$search' => {
39-
'index' => 'your_search_index_name',
40+
'index' => '<your_search_index_name>',
4041
'text' => {
4142
'query' => 'Salt',
4243
'path' => 'name'

0 commit comments

Comments
 (0)