Skip to content

Commit 736cfcb

Browse files
committed
getting started: tweak examples and links
1 parent 8875838 commit 736cfcb

35 files changed

+470
-153
lines changed

primer/source/aggregation.txt

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,4 @@ Prerequisites
2121
Additional Information
2222
----------------------
2323

24-
For more information on the aggregation method, see the following
25-
documentation in the MongoDB Manual:
26-
27-
- :manual:`Aggregation Quick Reference
28-
</meta/aggregation-quick-reference>`.
29-
30-
- :manual:`SQL to Aggregation Mapping Chart
31-
</reference/sql-aggregation-comparison>`.
32-
33-
- :manual:`Aggregation documentation </core/aggregation-introduction>` for more
34-
information on aggregation in MongoDB, including other aggregation
35-
methods.
36-
37-
- :manual:`Zip Code Aggregation Tutorial
38-
</tutorial/aggregation-zip-code-data-set>` and the :manual:`User
39-
Preference Aggregation Tutorial
40-
</tutorial/aggregation-with-user-preference-data>`.
24+
.. include:: /includes/extracts/aggregation-additional-info.rst

primer/source/includes/client-shell.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Start ``mongo``
1414

1515
Once you have :doc:`installed and have started </installation>`
1616
MongoDB, connect the :program:`mongo` shell to your running MongoDB
17-
instance. Ensure MongoDB is running before attempting to launch the
17+
instance. Ensure that MongoDB is running before attempting to launch the
1818
:program:`mongo` shell.
1919

2020
On the same system where the MongoDB is running, open a terminal window

primer/source/includes/examples-insert.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ ref: java-insert-a-document
184184
edition: java
185185
operation:
186186
- pre: |
187-
To specify a document, use the `org.bson.Document
188-
<http://api.mongodb.org/java/3.0/org/bson/Document.html>`_ class.
187+
To specify a document, use the org.bson.Document_ class.
189188
- literalinclude: includes/example-java-insert-a-document.java
190189
language: java
191190
- post: |

primer/source/includes/examples-query-sort.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ operation:
144144
- literalinclude: includes/example-java-sort-pre2.java
145145
language: java
146146
replacement:
147-
sortMethod: "`sort() <http://api.mongodb.org/java/3.0/com/mongodb/async/client/FindIterable.html#sort(org.bson.conversions.Bson)>`_"
147+
sortMethod: "`sort() <http://api.mongodb.org/java/3.0/com/mongodb/async/client/FindIterable.html#sort-org.bson.conversions.Bson->`_"
148148
ascKey: "``1``"
149149
descKey: "``-1``"
150150
...

primer/source/includes/examples-remove.yaml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ edition:
1010
- java
1111
ref: example-collection
1212
---
13+
edition: shell
1314
source:
1415
file: examples-remove-base.yaml
1516
ref: _remove-matching-documents
1617
ref: remove-matching-documents
17-
edition: shell
1818
operation:
1919
language: javascript
2020
code: |
@@ -24,11 +24,11 @@ post: |
2424
contains the status of the operation. :data:`~WriteResult.nRemoved`
2525
field specifies the number of documents removed.
2626
---
27+
edition: shell
2728
source:
2829
file: examples-remove-base.yaml
2930
ref: _remove-justOne
3031
ref: remove-justOne
31-
edition: shell
3232
operation:
3333
- language: javascript
3434
code: |
@@ -44,11 +44,11 @@ final: |
4444
replacement:
4545
removeMethod: :method:`~db.collection.remove()`
4646
---
47+
edition: shell
4748
source:
4849
file: examples-remove-base.yaml
4950
ref: _remove-all-documents
5051
ref: remove-all-documents
51-
edition: shell
5252
operation:
5353
language: javascript
5454
code: |
@@ -60,11 +60,11 @@ post: |
6060
replacement:
6161
removeMethod: :method:`~db.collection.remove()`
6262
---
63+
edition: shell
6364
source:
6465
file: examples-remove-base.yaml
6566
ref: _drop-collection
6667
ref: drop-collection
67-
edition: shell
6868
operation:
6969
language: javascript
7070
code: |
@@ -80,11 +80,11 @@ final: |
8080
replacement:
8181
dropMethod: :method:`~db.collection.drop()`
8282
---
83+
edition: python
8384
source:
8485
file: examples-remove-base.yaml
8586
ref: _remove-matching-documents
8687
ref: remove-matching-documents
87-
edition: python
8888
operation:
8989
- language: python
9090
code: |
@@ -111,11 +111,11 @@ operation:
111111
replacement:
112112
removeMethod: :py:meth:`~pymongo.collection.Collection.delete_many`
113113
---
114+
edition: python
114115
source:
115116
file: examples-remove-base.yaml
116117
ref: _remove-all-documents
117118
ref: remove-all-documents
118-
edition: python
119119
operation:
120120
- language: python
121121
code: |
@@ -142,23 +142,23 @@ operation:
142142
replacement:
143143
removeMethod: :py:meth:`~pymongo.collection.Collection.delete_many`
144144
---
145+
edition: python
145146
source:
146147
file: examples-remove-base.yaml
147148
ref: _drop-collection
148149
ref: drop-collection
149-
edition: python
150150
operation:
151151
language: python
152152
code: |
153153
db.restaurants.drop()
154154
replacement:
155155
dropMethod: :py:meth:`~pymongo.collection.Collection.drop`
156156
---
157+
edition: node
157158
source:
158159
file: examples-remove-base.yaml
159160
ref: _remove-matching-documents
160161
ref: remove-matching-documents
161-
edition: node
162162
operation:
163163
- pre: |
164164
Define a ``removeRestaurants`` function as follows:
@@ -189,12 +189,12 @@ post: |
189189
replacement:
190190
removeMethod: "deleteMany_"
191191
---
192+
edition: node
192193
source:
193194
file: examples-remove-base.yaml
194195
ref: _remove-justOne
195196
ref: remove-justOne
196197
title: "Remove just one document."
197-
edition: node
198198
operation:
199199
- pre: |
200200
Define a ``removeRestaurants`` function as follows:
@@ -225,11 +225,11 @@ post: |
225225
replacement:
226226
removeMethod: "deleteOne_"
227227
---
228+
edition: node
228229
source:
229230
file: examples-remove-base.yaml
230231
ref: _remove-all-documents
231232
ref: remove-all-documents
232-
edition: node
233233
operation:
234234
- pre: |
235235
Define a ``removeRestaurants`` function as follows:
@@ -257,11 +257,11 @@ post: |
257257
replacement:
258258
removeMethod: "deleteMany_"
259259
---
260+
edition: node
260261
source:
261262
file: examples-remove-base.yaml
262263
ref: _drop-collection
263264
ref: drop-collection
264-
edition: node
265265
operation:
266266
- pre: |
267267
Define a ``dropRestaurants`` function as follows:
@@ -334,6 +334,7 @@ operation:
334334
language: cpp
335335
replacement:
336336
dropMethod: "drop_"
337+
---
337338
source:
338339
file: examples-remove-base.yaml
339340
ref: _remove-matching-documents
@@ -353,10 +354,10 @@ source:
353354
ref: remove-all-documents
354355
edition: java
355356
operation:
356-
- literalinclude: includes/example-java-remove-matching-documents.java
357+
- literalinclude: includes/example-java-remove-all-documents.java
357358
language: java
358359
- post: |
359-
.. include:: includes/example-java-remove-matching-documents-post.rst
360+
.. include:: includes/example-java-remove-all-documents-post.rst
360361
replacement:
361362
removeMethod: "deleteMany_"
362363
---
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ref: _aggregation-additional-info
2+
content: |
3+
In the {{driver}}, see {{aggregate}}.
4+
5+
In the MongoDB Manual, see also :manual:`Aggregation Quick Reference
6+
</meta/aggregation-quick-reference>`, the :manual:`SQL to Aggregation
7+
Mapping Chart </reference/sql-aggregation-comparison>`, and
8+
:manual:`Aggregation Introduction </core/aggregation-introduction>`.
9+
...
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
edition: shell
2+
ref: aggregation-additional-info
3+
inherit:
4+
ref: _aggregation-additional-info
5+
file: extracts-aggregation-additional-info-base.yaml
6+
replacement:
7+
driver: MongoDB Manual
8+
aggregate: :method:`~db.collection.aggregate()`
9+
---
10+
edition: python
11+
ref: aggregation-additional-info
12+
inherit:
13+
ref: _aggregation-additional-info
14+
file: extracts-aggregation-additional-info-base.yaml
15+
replacement:
16+
driver: PyMongo documentation
17+
aggregate: :py:meth:`~pymongo.collection.Collection.aggregate()`
18+
---
19+
edition: node
20+
ref: aggregation-additional-info
21+
inherit:
22+
ref: _aggregation-additional-info
23+
file: extracts-aggregation-additional-info-base.yaml
24+
replacement:
25+
driver: Node.js documentation
26+
aggregate: "aggregate_"
27+
post: |
28+
.. _aggregate: http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#aggregate
29+
---
30+
edition: cpp
31+
ref: aggregation-additional-info
32+
inherit:
33+
ref: _aggregation-additional-info
34+
file: extracts-aggregation-additional-info-base.yaml
35+
replacement:
36+
driver: C++ Driver documentation
37+
aggregate: "aggregate_ and pipeline_"
38+
---
39+
edition: java
40+
ref: aggregation-additional-info
41+
inherit:
42+
ref: _aggregation-additional-info
43+
file: extracts-aggregation-additional-info-base.yaml
44+
replacement:
45+
driver: Java Driver documentation
46+
aggregate: "aggregate_, AggregateIterable_, Block_"
47+
post: |
48+
.. _Block: http://api.mongodb.org/java/3.0/com/mongodb/Block.html
49+
.. _AggregateIterable: http://api.mongodb.org/java/3.0/com/mongodb/client/AggregateIterable.html
50+
...

primer/source/includes/extracts-aggregation-overview.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,49 @@
1+
edition: shell
12
ref: aggregation-overview
23
replacement:
34
aggregate: :method:`~db.collection.aggregate()`
45
inherit:
56
ref: _aggregation-overview
67
file: extracts-aggregation-overview-base.yaml
7-
edition: shell
88
post: |
99
1010
.. code-block:: javascript
1111
1212
db.collection.aggregate( [ <stage1>, <stage2>, ... ] )
1313
---
14+
edition: python
1415
ref: aggregation-overview
1516
replacement:
1617
aggregate: :py:meth:`~pymongo.collection.Collection.aggregate()`
1718
inherit:
1819
ref: _aggregation-overview
1920
file: extracts-aggregation-overview-base.yaml
20-
edition: python
21-
2221
post: |
2322
2423
.. code-block:: python
2524
2625
db.collection.aggregate([<stage1>, <stage2>, ...])
2726
2827
---
28+
edition: node
2929
ref: aggregation-overview
3030
replacement:
3131
aggregate: "`aggregate <http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#aggregate>`_"
3232
inherit:
3333
ref: _aggregation-overview
3434
file: extracts-aggregation-overview-base.yaml
35-
edition: node
3635
post: |
3736
3837
.. code-block:: javascript
3938
4039
db.collection.aggregate( [ <stage1>, <stage2>, ... ] )
4140
4241
---
42+
edition: cpp
4343
ref: aggregation-overview
4444
inherit:
4545
ref: _aggregation-overview
4646
file: extracts-aggregation-overview-base.yaml
47-
edition: cpp
4847
content: |
4948
MongoDB can perform aggregation operations, such as grouping by a
5049
specified key and evaluating a total or a count for each distinct group.
@@ -61,13 +60,13 @@ content: |
6160
replacement:
6261
aggregate: "aggregate_"
6362
---
63+
edition: java
6464
ref: aggregation-overview
6565
inherit:
6666
ref: _aggregation-overview
6767
file: extracts-aggregation-overview-base.yaml
68-
edition: java
6968
post: |
70-
.. _aggregate: http://api.mongodb.org/java/3.0/com/mongodb/client/MongoCollection.html#aggregate(java.util.List,%20java.lang.Class)
69+
.. _aggregate: http://api.mongodb.org/java/3.0/com/mongodb/client/MongoCollection.html#aggregate-java.util.List-
7170
replacement:
7271
aggregate: "aggregate_"
7372
...

primer/source/includes/extracts-connect.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ content: |
1616
ref: java-connect
1717
edition: java
1818
content: |
19-
The variable ``db`` in the example(s) below refers to the ``test``
20-
database of the connected MongoDB. See :ref:`Connect to MongoDB
21-
<java-download-connect>` to connect to a running MongoDB instance and
22-
access the ``test`` database.
19+
Follow the :ref:`Connect to MongoDB <java-download-connect>` step to
20+
connect to a running MongoDB instance and declare and define the
21+
variable ``db`` as to access the ``test`` database.
2322
...
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
ref: _indexes-additional-info
22
content: |
3-
MongoDB provides several different index types to support different
4-
kinds of queries and data sets. See the :manual:`Index Introduction
5-
</core/indexes-introduction>` in the Mongodb Manual for the different
6-
index types supported in MongoDB.
3+
You can specify various properties for indexes, such as a
4+
:manual:`unique constraint </core/index-unique>`. In the {{driver}},
5+
see {{index}} for the available options.
76
8-
You can also specify various properties for indexes, such as a
9-
:manual:`unique constraint </core/index-unique>`. For the options
10-
available, refer to {{index}} API.
7+
MongoDB provides different index types to support different
8+
kinds of queries and datasets. In the MongoDB Manual, see the
9+
:manual:`Index Introduction </core/indexes-introduction>` for the
10+
different index types supported in MongoDB.
1111
...

0 commit comments

Comments
 (0)