Skip to content

Commit 0d23ac9

Browse files
authored
DOCSP-37931: cleanup (#24)
1 parent e7779be commit 0d23ac9

25 files changed

+268
-272
lines changed

snooty.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ intersphinx = [ "https://www.mongodb.com/docs/manual/objects.inv",
55
"https://www.mongodb.com/docs/atlas/objects.inv"
66
]
77

8+
sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/"
9+
810
toc_landing_pages = [
911
"/tutorials/connect/",
1012
"/tutorials/write-ops/",

source/get-started/pojo-qs.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
Quick Start (POJO Examples)
55
===========================
66

7+
.. facet::
8+
:name: genre
9+
:values: tutorial
10+
11+
.. meta::
12+
:keywords: code example, get started, connect, change data, POJO
13+
714
.. contents:: On this page
815
:local:
916
:backlinks: none
@@ -18,10 +25,7 @@ The code examples in this guide come from the `PojoQuickTour.java
1825
<{+driver-source-gh+}/blob/master/driver-reactive-streams/src/examples/reactivestreams/tour/PojoQuickTour.java>`__
1926
file in the driver source code GitHub repository.
2027

21-
.. important::
22-
23-
This guide uses the ``Subscriber`` implementations, which are
24-
described in the :ref:`Quick Start Primer <javars-primer>`.
28+
.. include:: /includes/subscriber-note.rst
2529

2630
Prerequisites
2731
-------------

source/get-started/primer.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
Primer
55
======
66

7+
.. facet::
8+
:name: genre
9+
:values: reference
10+
11+
.. meta::
12+
:keywords: code example, design, types
13+
714
.. contents:: On this page
815
:local:
916
:backlinks: none

source/get-started/quickstart.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
Quick Start
55
===========
66

7+
.. facet::
8+
:name: genre
9+
:values: tutorial
10+
11+
.. meta::
12+
:keywords: code example, get started, connect, change data
13+
714
.. contents:: On this page
815
:local:
916
:backlinks: none
@@ -19,10 +26,7 @@ file in the driver source code GitHub repository.
1926
For instructions about how to install the {+driver-short+},
2027
see the :ref:`installation guide <javars-install>`.
2128

22-
.. important::
23-
24-
This guide uses the ``Subscriber`` implementations, which are
25-
described in the :ref:`Quick Start Primer <javars-primer>`.
29+
.. include:: /includes/subscriber-note.rst
2630

2731
Prerequisites
2832
-------------

source/includes/connect-section.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
First, connect to a MongoDB deployment, then declare and define
2+
``MongoDatabase`` and ``MongoCollection`` instances.
3+
4+
The following code connects to a standalone
5+
MongoDB deployment running on ``localhost`` on port ``27017``. Then, it
6+
defines the ``database`` variable to refer to the ``test`` database and
7+
the ``collection`` variable to refer to the ``restaurants`` collection:
8+
9+
.. code-block:: java
10+
11+
MongoClient mongoClient = MongoClients.create();
12+
MongoDatabase database = mongoClient.getDatabase("test");
13+
MongoCollection<Document> collection = database.getCollection("restaurants");
14+
15+
To learn more about connecting to MongoDB deployments,
16+
see the :ref:`javars-connect` tutorial.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
You must set up the following components to run the code examples in
2+
this guide:
3+
4+
- A ``test.restaurants`` collection populated with documents from the
5+
``restaurants.json`` file in the `documentation assets GitHub
6+
<https://raw.githubusercontent.com/mongodb/docs-assets/drivers/restaurants.json>`__.
7+
8+
- The following import statements:

source/includes/subscriber-note.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. important::
2+
3+
This guide uses the ``Subscriber`` implementations, which are
4+
described in the :ref:`Quick Start Primer <javars-primer>`.

source/reference/logging.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
Logging
55
=======
66

7+
.. facet::
8+
:name: genre
9+
:values: reference
10+
11+
.. meta::
12+
:keywords: record logs, log types
13+
714
By default, logging is enabled via the popular `SLF4J
815
<https://www.slf4j.org/>`__ API. Logging is optional, so the driver
916
uses SLF4J if the driver detects the presence of SLF4J API (class

source/reference/monitoring.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
JMX Monitoring
55
==============
66

7+
.. facet::
8+
:name: genre
9+
:values: reference
10+
11+
.. meta::
12+
:keywords: code example, record messages
13+
714
.. contents:: On this page
815
:local:
916
:backlinks: none

source/tutorials/aggregation.txt

Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
Aggregation Framework
55
=====================
66

7+
.. facet::
8+
:name: genre
9+
:values: reference
10+
11+
.. meta::
12+
:keywords: code example, create insights, change data
13+
714
.. contents:: On this page
815
:local:
916
:backlinks: none
@@ -19,52 +26,27 @@ To learn more about aggregation, see :manual:`Aggregation Pipeline
1926
Prerequisites
2027
-------------
2128

22-
You must set up the following components to run the code examples in
23-
this guide:
24-
25-
- A ``test.restaurants`` collection populated with documents from the
26-
``restaurants.json`` file in the `documentation assets GitHub
27-
<https://raw.githubusercontent.com/mongodb/docs-assets/drivers/restaurants.json>`__.
28-
29-
- The following import statements:
30-
31-
.. code-block:: java
32-
33-
import com.mongodb.reactivestreams.client.MongoClients;
34-
import com.mongodb.reactivestreams.client.MongoClient;
35-
import com.mongodb.reactivestreams.client.MongoCollection;
36-
import com.mongodb.reactivestreams.client.MongoDatabase;
37-
import com.mongodb.client.model.Aggregates;
38-
import com.mongodb.client.model.Accumulators;
39-
import com.mongodb.client.model.Projections;
40-
import com.mongodb.client.model.Filters;
41-
42-
import org.bson.Document;
29+
.. include:: /includes/prereq-restaurants.rst
4330

44-
.. important::
31+
.. code-block:: java
32+
33+
import com.mongodb.reactivestreams.client.MongoClients;
34+
import com.mongodb.reactivestreams.client.MongoClient;
35+
import com.mongodb.reactivestreams.client.MongoCollection;
36+
import com.mongodb.reactivestreams.client.MongoDatabase;
37+
import com.mongodb.client.model.Aggregates;
38+
import com.mongodb.client.model.Accumulators;
39+
import com.mongodb.client.model.Projections;
40+
import com.mongodb.client.model.Filters;
41+
42+
import org.bson.Document;
4543

46-
This guide uses the ``Subscriber`` implementations, which are
47-
described in the :ref:`Quick Start Primer <javars-primer>`.
44+
.. include:: /includes/subscriber-note.rst
4845

4946
Connect to a MongoDB Deployment
5047
-------------------------------
5148

52-
First, connect to a MongoDB deployment, then declare and define
53-
``MongoDatabase`` and ``MongoCollection`` instances.
54-
55-
The following code connects to a standalone
56-
MongoDB deployment running on ``localhost`` on port ``27017``. Then, it
57-
defines the ``database`` variable to refer to the ``test`` database and
58-
the ``collection`` variable to refer to the ``restaurants`` collection:
59-
60-
.. code-block:: java
61-
62-
MongoClient mongoClient = MongoClients.create();
63-
MongoDatabase database = mongoClient.getDatabase("test");
64-
MongoCollection<Document> collection = database.getCollection("restaurants");
65-
66-
To learn more about connecting to MongoDB deployments,
67-
see the :ref:`javars-connect` tutorial.
49+
.. include:: /includes/connect-section.rst
6850

6951
Perform Aggregation
7052
-------------------

source/tutorials/bulk-writes.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
Bulk Write Operations
55
=====================
66

7+
.. facet::
8+
:name: genre
9+
:values: reference
10+
11+
.. meta::
12+
:keywords: code example, multiple changes
13+
714
Starting in v2.6, MongoDB supports bulk write commands
815
for insert, update, and delete operations in a way that allows the
916
driver to implement the correct semantics for ``BulkWriteResult`` and
@@ -18,10 +25,7 @@ operations:
1825
the errors. Unordered bulk operations do not guarantee an order of
1926
execution.
2027

21-
.. important::
22-
23-
This guide uses the ``Subscriber`` implementations, which are
24-
described in the :ref:`Quick Start Primer <javars-primer>`.
28+
.. include:: /includes/subscriber-note.rst
2529

2630
The following code provides examples using ordered and unordered
2731
operations:

source/tutorials/change-stream.txt

Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
Change Streams
55
==============
66

7+
.. facet::
8+
:name: genre
9+
:values: reference
10+
11+
.. meta::
12+
:keywords: code example, watch for changes
13+
714
.. contents:: On this page
815
:local:
916
:backlinks: none
@@ -22,53 +29,28 @@ attempts to resume if it encounters a potentially recoverable error.
2229
Prerequisites
2330
-------------
2431

25-
You must set up the following components to run the code examples in
26-
this guide:
27-
28-
- A ``test.restaurants`` collection populated with documents from the
29-
``restaurants.json`` file in the `documentation assets GitHub
30-
<https://raw.githubusercontent.com/mongodb/docs-assets/drivers/restaurants.json>`__.
32+
.. include:: /includes/prereq-restaurants.rst
3133

32-
- The following import statements:
33-
34-
.. code-block:: java
35-
36-
import com.mongodb.reactivestreams.client.MongoClients;
37-
import com.mongodb.reactivestreams.client.MongoClient;
38-
import com.mongodb.reactivestreams.client.MongoCollection;
39-
import com.mongodb.reactivestreams.client.MongoDatabase;
40-
41-
import com.mongodb.client.model.Aggregates;
42-
import com.mongodb.client.model.Filters;
43-
import com.mongodb.client.model.changestream.FullDocument;
44-
import com.mongodb.client.model.changestream.ChangeStreamDocument;
45-
46-
import org.bson.Document;
34+
.. code-block:: java
4735

48-
.. important::
36+
import com.mongodb.reactivestreams.client.MongoClients;
37+
import com.mongodb.reactivestreams.client.MongoClient;
38+
import com.mongodb.reactivestreams.client.MongoCollection;
39+
import com.mongodb.reactivestreams.client.MongoDatabase;
40+
41+
import com.mongodb.client.model.Aggregates;
42+
import com.mongodb.client.model.Filters;
43+
import com.mongodb.client.model.changestream.FullDocument;
44+
import com.mongodb.client.model.changestream.ChangeStreamDocument;
45+
46+
import org.bson.Document;
4947

50-
This guide uses the ``Subscriber`` implementations, which are
51-
described in the :ref:`Quick Start Primer <javars-primer>`.
48+
.. include:: /includes/subscriber-note.rst
5249

5350
Connect to a MongoDB Deployment
5451
-------------------------------
5552

56-
First, connect to a MongoDB deployment, then declare and define
57-
``MongoDatabase`` and ``MongoCollection`` instances.
58-
59-
The following code connects to a standalone
60-
MongoDB deployment running on ``localhost`` on port ``27017``. Then, it
61-
defines the ``database`` variable to refer to the ``test`` database and
62-
the ``collection`` variable to refer to the ``restaurants`` collection:
63-
64-
.. code-block:: java
65-
66-
MongoClient mongoClient = MongoClients.create();
67-
MongoDatabase database = mongoClient.getDatabase("test");
68-
MongoCollection<Document> collection = database.getCollection("restaurants");
69-
70-
To learn more about connecting to MongoDB deployments,
71-
see the :ref:`javars-connect` tutorial.
53+
.. include:: /includes/connect-section.rst
7254

7355
Watch for Changes on a Collection
7456
---------------------------------

source/tutorials/command.txt

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
Run Commands
55
============
66

7+
.. facet::
8+
:name: genre
9+
:values: reference
10+
11+
.. meta::
12+
:keywords: code example, database command
13+
714
.. contents:: On this page
815
:local:
916
:backlinks: none
@@ -20,14 +27,7 @@ in the Server manual.
2027
Prerequisites
2128
-------------
2229

23-
You must set up the following components to run the code examples in
24-
this guide:
25-
26-
- A ``test.restaurants`` collection populated with documents from the
27-
``restaurants.json`` file in the `documentation assets GitHub
28-
<https://raw.githubusercontent.com/mongodb/docs-assets/drivers/restaurants.json>`__.
29-
30-
- The following import statements:
30+
.. include:: /includes/prereq-restaurants.rst
3131

3232
.. code-block:: java
3333

@@ -36,10 +36,7 @@ this guide:
3636
import com.mongodb.reactivestreams.client.MongoDatabase;
3737
import org.bson.Document;
3838

39-
.. important::
40-
41-
This guide uses the ``Subscriber`` implementations, which are
42-
described in the :ref:`Quick Start Primer <javars-primer>`.
39+
.. include:: /includes/subscriber-note.rst
4340

4441
Connect to a MongoDB Deployment
4542
-------------------------------

source/tutorials/connect.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
Connect to MongoDB
55
==================
66

7+
.. facet::
8+
:name: genre
9+
:values: reference
10+
11+
.. meta::
12+
:keywords: code example, connect to MongoDB, modify connection
13+
714
.. toctree::
815

916
/tutorials/connect/tls/

source/tutorials/connect/auth.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
Authentication
55
==============
66

7+
.. facet::
8+
:name: genre
9+
:values: reference
10+
11+
.. meta::
12+
:keywords: code example, verify, AWS, Kerberos
13+
714
.. contents:: On this page
815
:local:
916
:backlinks: none

0 commit comments

Comments
 (0)