diff --git a/source/connection/connect.txt b/source/connection/connect.txt index 5d7bc35c7..a8e4c8169 100644 --- a/source/connection/connect.txt +++ b/source/connection/connect.txt @@ -295,8 +295,7 @@ check the following items in your code: - The credentials for the authentication mechanism that you specified are correct. To learn how to specify your credentials, see the - :ref:`authentication-mechanisms` and :ref:`enterprise-authentication-mechanisms` - guides. + :ref:`authentication-mechanisms` guide. - The name of the authentication database that you specified is correct. To learn how to set up the users and roles for your MongoDB deployment, see diff --git a/source/connection/connection-options.txt b/source/connection/connection-options.txt index e2855d376..d2b20c693 100644 --- a/source/connection/connection-options.txt +++ b/source/connection/connection-options.txt @@ -193,8 +193,8 @@ parameters of the connection URI to specify the behavior of the client. * - **authMechanism** - string - - Specifies the :doc:`authentication mechanism - ` that the driver uses if a credential + - Specifies the :ref:`authentication mechanism + ` that the driver uses if a credential was supplied. | **Default**: By default, the client picks the most secure diff --git a/source/connection/mongoclientsettings.txt b/source/connection/mongoclientsettings.txt index 708087be6..f6be3284c 100644 --- a/source/connection/mongoclientsettings.txt +++ b/source/connection/mongoclientsettings.txt @@ -112,7 +112,7 @@ connection behavior: - Sets the :ref:`command listeners `. * - ``compressorList()`` - - Sets the :ref:`compressors ` to use for compressing + - Sets the :ref:`compressors ` to use for compressing messages to the server. * - ``credential()`` @@ -162,7 +162,7 @@ Example This example demonstrates specifying a ``ConnectionString``: -.. literalinclude:: /includes/fundamentals/code-snippets/mcs.java +.. literalinclude:: /includes/fundamentals/code-snippets/MCSettings.java :start-after: begin ConnectionString :end-before: end ConnectionString :language: java @@ -290,7 +290,7 @@ Example This example specifies for the driver to connect directly to a server, regardless of the type of MongoDB cluster it's a part of: -.. literalinclude:: /includes/fundamentals/code-snippets/mcs.java +.. literalinclude:: /includes/fundamentals/code-snippets/MCSettings.java :start-after: begin ClusterSettings :end-before: end ClusterSettings :language: java @@ -380,7 +380,7 @@ This example specifies the following driver behavior in a pool of - The thread to wait at most ``10 SECONDS`` for an available connection - To have at most ``200`` connections associated with the pool -.. literalinclude:: /includes/fundamentals/code-snippets/mcs.java +.. literalinclude:: /includes/fundamentals/code-snippets/MCSettings.java :start-after: begin ConnectionPoolSettings :end-before: end ConnectionPoolSettings :language: java @@ -417,7 +417,7 @@ Example This example specifies that the maximum number of characters for a single log message is set to ``5000`` characters. -.. literalinclude:: /includes/fundamentals/code-snippets/mcs.java +.. literalinclude:: /includes/fundamentals/code-snippets/MCSettings.java :start-after: begin LoggerSettings :end-before: end LoggerSettings :language: java @@ -474,7 +474,7 @@ This example specifies the following driver behavior in a MongoDB deployment: ``700 MILLISECONDS`` - The cluster monitor to attempt reaching a server every ``15 SECONDS`` -.. literalinclude:: /includes/fundamentals/code-snippets/mcs.java +.. literalinclude:: /includes/fundamentals/code-snippets/MCSettings.java :start-after: begin ServerSettings :end-before: end ServerSettings :language: java @@ -545,7 +545,7 @@ This example specifies the following driver behavior in a MongoDB socket: - To connect to an available socket within ``10 SECONDS`` - To read from an available socket within ``15 SECONDS`` -.. literalinclude:: /includes/fundamentals/code-snippets/mcs.java +.. literalinclude:: /includes/fundamentals/code-snippets/MCSettings.java :start-after: begin SocketSettings :end-before: end SocketSettings :language: java @@ -593,7 +593,7 @@ Example This example specifies for the driver to enable TLS/SSL when connecting to MongoDB: -.. literalinclude:: /includes/fundamentals/code-snippets/mcs.java +.. literalinclude:: /includes/fundamentals/code-snippets/MCSettings.java :start-after: begin SslSettings :end-before: end SslSettings :language: java diff --git a/source/crud/builders/aggregates.txt b/source/crud/builders/aggregates.txt index 7fad13f49..54f2b9009 100644 --- a/source/crud/builders/aggregates.txt +++ b/source/crud/builders/aggregates.txt @@ -1,3 +1,5 @@ +.. _aggregates-builders: + =================== Aggregates Builders =================== @@ -17,9 +19,7 @@ Aggregates Builders .. toctree:: - Atlas Vector Search - -.. _aggregates-builders: + Atlas Vector Search Overview -------- @@ -90,7 +90,7 @@ Project Use the ``project()`` method to create a :manual:`$project ` pipeline stage that project specified document fields. Field projection -in aggregation follows the same rules as :doc:`field projection in queries `. +in aggregation follows the same rules as :ref:`field projection in queries `. .. tip:: diff --git a/source/crud/builders/filters.txt b/source/crud/builders/filters.txt index 8c406cc81..84f9ddb57 100644 --- a/source/crud/builders/filters.txt +++ b/source/crud/builders/filters.txt @@ -1,17 +1,15 @@ +.. _filters-builders: + ================ Filters Builders ================ - - .. contents:: On this page :local: :backlinks: none :depth: 2 :class: singlecol -.. _filters-builders: - Overview -------- @@ -19,8 +17,8 @@ In this guide, you can learn how to use **builders** to specify **filters** for your queries in the MongoDB Java driver. Builders are classes provided by the MongoDB Java driver that help you -construct :ref:`BSON ` objects. To learn more, see our :doc:`guide -on builders `. +construct :ref:`BSON ` objects. To learn more, see our :ref:`guide +on builders `. Filters are the operations MongoDB uses to limit your results to what you want to see. diff --git a/source/crud/builders/indexes.txt b/source/crud/builders/indexes.txt index 6fbee75cb..29bbbf459 100644 --- a/source/crud/builders/indexes.txt +++ b/source/crud/builders/indexes.txt @@ -1,22 +1,20 @@ +.. _indexes-builders: + ================ Indexes Builders ================ - - .. contents:: On this page :local: :backlinks: none :depth: 2 :class: singlecol -.. _indexes-builders: - Overview -------- In this guide, you can learn how to specify **indexes** using -:doc:`builders ` in the MongoDB Java driver. +:ref:`builders ` in the MongoDB Java driver. The ``Indexes`` builder provides helper methods for constructing the following types of indexes: @@ -29,7 +27,7 @@ following types of indexes: Indexes store a subset of the collection’s data set. The index stores the value of a specific field or set of fields, ordered by the value of -the field. See our guide on :doc:`Indexes ` for +the field. See our guide on :ref:`Indexes ` for examples of queries covered by indexes. The ``Indexes`` class provides static factory methods for all the MongoDB index types. diff --git a/source/crud/builders/projections.txt b/source/crud/builders/projections.txt index 8c1e29602..a44699266 100644 --- a/source/crud/builders/projections.txt +++ b/source/crud/builders/projections.txt @@ -1,22 +1,20 @@ +.. _projections-builders: + ==================== Projections Builders ==================== - - .. contents:: On this page :local: :backlinks: none :depth: 2 :class: singlecol -.. _projections-builders: - Overview -------- In this guide, you can learn how to specify **projections** using -:doc:`builders ` in the MongoDB Java driver. +:ref:`builders ` in the MongoDB Java driver. MongoDB supports **field projection**, specifying which fields to include and exclude when returning results from a query. Projection in MongoDB follows some basic rules: diff --git a/source/crud/builders/sort.txt b/source/crud/builders/sort.txt index f73f01b2e..f53526c90 100644 --- a/source/crud/builders/sort.txt +++ b/source/crud/builders/sort.txt @@ -1,3 +1,5 @@ +.. _sorts-builders: + ============== Sorts Builders ============== @@ -15,8 +17,6 @@ Sorts Builders :depth: 2 :class: singlecol -.. _sorts-builders: - Overview -------- @@ -31,15 +31,15 @@ examples of sort criteria are: * Alphabetical order by first name Builders are classes provided by the MongoDB Java driver that help you -construct :ref:`BSON ` objects. To learn more, see our :doc:`guide -on builders `. +construct :ref:`BSON ` objects. To learn more, see our :ref:`guide +on builders `. You should read this guide if you would like to use builders to specify sort criteria for your queries. If you want to learn the fundamentals of sorting in the MongoDB Java driver, consider reading our -:doc:`guide on sorting `. +:ref:`guide on sorting `. .. _sorts-builders-sort-sample: @@ -63,7 +63,7 @@ criteria operators supported by MongoDB. These methods return a ``Bson`` object that you can pass to the ``sort()`` method of a ``FindIterable`` instance or to ``Aggregates.sort()``. If you want to learn more about the ``Aggregates`` class, see our -:doc:`guide on the Aggregates builder `. +:ref:`guide on the Aggregates builder `. For more information about the classes and interfaces in this section, see the following API Documentation: diff --git a/source/crud/collations.txt b/source/crud/collations.txt index ee752fba1..5305d37da 100644 --- a/source/crud/collations.txt +++ b/source/crud/collations.txt @@ -71,7 +71,7 @@ order as shown below: How to Specify Collations ------------------------- -MongoDB supports collations on most :doc:`CRUD operations ` +MongoDB supports collations on most :ref:`CRUD operations ` and aggregations. For a complete list of supported operations, see the :manual:`Operations that Support Collations ` server manual page. diff --git a/source/crud/compound-operations.txt b/source/crud/compound-operations.txt index 71571a303..1894761e2 100644 --- a/source/crud/compound-operations.txt +++ b/source/crud/compound-operations.txt @@ -101,10 +101,10 @@ The output of the preceding code resembles the following: {"food": "pizza", "color": "green"} For more information about the ``Projections`` class, see our -:doc:`guide on the Projections builder `. +:ref:`guide on the Projections builder `. For more information about the upsert operation, see our -:doc:`guide on upserts `. +:ref:`guide on upserts `. For more information about the methods and classes mentioned in this section, see the following API Documentation: @@ -187,7 +187,7 @@ The output of the preceding code resembles the following: {"_id": 2, "food": "pear", "color": "yellow"} For more information about the ``Sorts`` class, see our -:doc:`guide on the Sorts builder `. +:ref:`guide on the Sorts builder `. For more information about the methods and classes mentioned in this section, see the following API Documentation: @@ -318,10 +318,10 @@ instance: for the duration of your compound operation. For information on the ``Updates`` class, see our -:doc:`guide on the Updates builder `. +:ref:`guide on the Updates builder `. For more information of the ``Filters`` class, see our -:doc:`guide on the Filters builder `. +:ref:`guide on the Filters builder `. For more information about the ``findOneAndUpdate()`` method, see the API Documentation for the `MongoCollection class <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#findOneAndUpdate(org.bson.conversions.Bson,java.util.List,com.mongodb.client.model.FindOneAndUpdateOptions)>`__. diff --git a/source/crud/gridfs.txt b/source/crud/gridfs.txt index 72bbb3e7f..54512cd82 100644 --- a/source/crud/gridfs.txt +++ b/source/crud/gridfs.txt @@ -263,8 +263,8 @@ see the following resources: - `GridFSFindIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/gridfs/GridFSFindIterable.html>`__ API Documentation - `GridFSBucket.find() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/gridfs/GridFSBucket.html#find(org.bson.conversions.Bson)>`__ API Documentation -- :doc:`Sort Results ` -- :doc:`Limit the Number of Returned Results ` +- :ref:`Sort Results ` +- :ref:`Limit the Number of Returned Results ` .. _gridfs-download-files: diff --git a/source/crud/query-document.txt b/source/crud/query-document.txt index 136f3b4a8..2b16cf81c 100644 --- a/source/crud/query-document.txt +++ b/source/crud/query-document.txt @@ -1,9 +1,9 @@ +.. _java-query: + =============== Specify a Query =============== - - .. contents:: On this page :local: :backlinks: none diff --git a/source/crud/read-operations/geo.txt b/source/crud/read-operations/geo.txt index d0e2c1fc5..346deeefb 100644 --- a/source/crud/read-operations/geo.txt +++ b/source/crud/read-operations/geo.txt @@ -115,7 +115,7 @@ GeoJSON data to a ``2dsphere`` index. The following snippet creates a collection.createIndex(Indexes.geo2dsphere("location.geo")); For more information about the ``Indexes`` builder, see our -:doc:`guide on the Indexes builder `. +:ref:`guide on the Indexes builder `. .. guide resource @@ -166,7 +166,7 @@ legacy coordinate pairs to a ``2d`` index. The following snippet creates a collection.createIndex(Indexes.geo2d("coordinates")); For more information about the ``Indexes`` builder, see our -:doc:`guide on the Indexes builder `. +:ref:`guide on the Indexes builder `. For more information about legacy coordinate pairs, see the :manual:`{+mdb-server+} manual page on legacy coordinate pairs `. @@ -208,7 +208,7 @@ For more information about geospatial query operators, see the .. external resource For more information about ``Filters``, see our -:doc:`guide on the Filters builder `. +:ref:`guide on the Filters builder `. Query Parameters ~~~~~~~~~~~~~~~~ @@ -229,7 +229,7 @@ Examples The following examples use the MongoDB Atlas sample dataset. You can learn how to set up your own free-tier Atlas cluster and how to load the sample dataset -in our :doc:`quick start guide `. +in our :ref:`quick start guide `. The examples use the ``theaters`` collection in the ``sample_mflix`` database from the sample dataset. The ``theaters`` collection contains a ``2dsphere`` index @@ -293,7 +293,7 @@ For more information about the ``$near`` operator, see :manual:`the reference documentation for $near `. For more information about ``Filters``, -:doc:`see our guide on the Filters builder `. +:ref:`see our guide on the Filters builder `. Query Within a Range ~~~~~~~~~~~~~~~~~~~~ diff --git a/source/crud/read-operations/limit.txt b/source/crud/read-operations/limit.txt index 41e0add3f..1ccb097db 100644 --- a/source/crud/read-operations/limit.txt +++ b/source/crud/read-operations/limit.txt @@ -25,7 +25,7 @@ to reach the specified limit, it can return a smaller number. If you use ``limit()`` with the ``skip()`` instance method, the skip applies first and the limit only applies to the documents left over after the skip. For more information about the ``skip()`` method, see our -:doc:`guide on Skipping Returned Documents `. +:ref:`guide on Skipping Returned Documents `. The following examples demonstrate, respectively, how to insert data into a collection, how to use ``limit()`` to restrict the number of returned documents, diff --git a/source/crud/read-operations/retrieve.txt b/source/crud/read-operations/retrieve.txt index 9d131fc99..c2de1b09d 100644 --- a/source/crud/read-operations/retrieve.txt +++ b/source/crud/read-operations/retrieve.txt @@ -53,8 +53,8 @@ to retrieve, in what order to retrieve them, and how many to retrieve. To perform a find operation, call the ``find()`` method on an instance of a ``MongoCollection``. This method searches a collection for documents that match the query filter you provide. For more information about how to -specify a query, see our :doc:`Specify a Query -` guide. +specify a query, see our :ref:`Specify a Query +` guide. Example ~~~~~~~ @@ -70,8 +70,8 @@ To address this scenario, the owner finds orders to match the criteria: :start-after: begin findExample :end-before: end findExample -For more information about how to build filters, see our :doc:`Filters Builders -` guide. +For more information about how to build filters, see our :ref:`Filters Builders +` guide. The following shows the output of the preceding query: @@ -84,8 +84,8 @@ The following shows the output of the preceding query: After the owner runs this query, they find two orders that matched the criteria. -For a runnable ``find()`` example, see our :doc:`Find Multiple -Documents ` page. +For a runnable ``find()`` example, see our :ref:`Find Multiple +Documents ` page. .. _retrieve-aggregate: @@ -101,7 +101,7 @@ instance of a ``MongoCollection``. This method accepts aggregation expressions to run in sequence. To perform aggregations, you can define aggregation stages that specify how to match documents, rename fields, and group values. For more information, see our -:doc:`Aggregation ` guide. +:ref:`Aggregation ` guide. Example ~~~~~~~ diff --git a/source/crud/read-operations/sort.txt b/source/crud/read-operations/sort.txt index 23b86f64f..3b5eb1df8 100644 --- a/source/crud/read-operations/sort.txt +++ b/source/crud/read-operations/sort.txt @@ -97,7 +97,7 @@ builder class. While it is possible to specify sort criteria using any class that implements the ``Bson`` interface, we recommend that you specify sort criteria through the ``Sorts`` builder. For more information about the ``Sorts`` builder class, see our -:doc:`guide on the Sorts builder `. +:ref:`guide on the Sorts builder `. For more information about the classes and interfaces in this section, see the following API Documentation: @@ -328,9 +328,9 @@ sort by the text score. In the following code example, we show how you can use the ``Sorts.metaTextScore()`` method to sort the results of a text search on the :ref:`sample collection `. -The code example uses the :doc:`Filters `, -:doc:`Indexes `, and -:doc:`Projections ` builders. +The code example uses the :ref:`Filters `, +:ref:`Indexes `, and +:ref:`Projections ` builders. The code example performs the following actions: #. Creates a text index for your diff --git a/source/crud/read-operations/text.txt b/source/crud/read-operations/text.txt index af6ff3e0d..5b6fb699e 100644 --- a/source/crud/read-operations/text.txt +++ b/source/crud/read-operations/text.txt @@ -82,8 +82,8 @@ Text Search Use the ``Filters.text()`` method to specify a text search. -The ``Filters.text()`` method uses the :doc:`Filters builder -` to define a query filter specifying +The ``Filters.text()`` method uses the :ref:`Filters builder +` to define a query filter specifying what to search for during the text search. The query filter is represented by a :ref:`BSON ` instance. Pass the query filter to the ``find()`` method to run a text search. diff --git a/source/crud/write-operations/embedded-arrays.txt b/source/crud/write-operations/embedded-arrays.txt index 9b58264af..c5f8aaf8a 100644 --- a/source/crud/write-operations/embedded-arrays.txt +++ b/source/crud/write-operations/embedded-arrays.txt @@ -39,7 +39,7 @@ The examples on this page use the ``findOneAndUpdate()`` method of the example uses an instance of the ``FindOneAndUpdateOptions`` class to have MongoDB retrieve the document after the update occurs. For more information on the ``findOneAndUpdate()`` method, see our -:doc:`Compound Operations guide `. +:ref:`Compound Operations guide `. Specifying an Update -------------------- diff --git a/source/crud/write-operations/insert.txt b/source/crud/write-operations/insert.txt index 1ffe6ac38..49fa6f734 100644 --- a/source/crud/write-operations/insert.txt +++ b/source/crud/write-operations/insert.txt @@ -28,7 +28,7 @@ methods. The following sections focus on ``insertOne()`` and ``insertMany()``. For information on how to use the ``bulkWrite()`` method, see our -:doc:`guide on Bulk Operations `. +:ref:`guide on Bulk Operations `. A Note About ``_id`` -------------------- @@ -53,6 +53,8 @@ you let the driver automatically generate ``_id`` values. For additional information on unique indexes, see the manual entry on :manual:`Unique Indexes `. +.. _java-insertone: + Insert a Single Document ------------------------ @@ -87,7 +89,7 @@ see the following resources: - `insertOne() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#insertOne(TDocument)>`__ API Documentation - `InsertOneResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/InsertOneResult.html>`__ API Documentation - Manual Explanation on :manual:`insertOne() ` -- Runnable :doc:`Insert a Document Example ` +- Runnable :ref:`Insert a Document Example ` Insert Multiple Documents ------------------------- @@ -165,7 +167,7 @@ see the following resources: - `insertMany() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#insertMany(java.util.List)>`__ API Documentation - `InsertManyResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/InsertManyResult.html>`__ API Documentation - Manual Explanation on :manual:`insertMany() ` -- Runnable :doc:`Insert Multiple Documents Example ` +- Runnable :ref:`Insert Multiple Documents Example ` Summary ------- diff --git a/source/crud/write-operations/modify.txt b/source/crud/write-operations/modify.txt index a8dbdf734..88e61f8ba 100644 --- a/source/crud/write-operations/modify.txt +++ b/source/crud/write-operations/modify.txt @@ -151,7 +151,7 @@ The following shows the updated documents in the ``paint_inventory`` collection: If zero documents match the query filter in the update operation, ``updateMany()`` makes no changes to documents in the collection. See -our :doc:`upsert guide ` to +our :ref:`upsert guide ` to learn how to insert a new document instead of updating one if no documents match. @@ -245,7 +245,7 @@ shown in the following code: If zero documents match the query filter in the replace operation, ``replaceOne()`` makes no changes to documents in the collection. See -our :doc:`upsert guide ` to +our :ref:`upsert guide ` to learn how to insert a new document instead of replacing one if no documents match. diff --git a/source/crud/write-operations/upsert.txt b/source/crud/write-operations/upsert.txt index 8d6238b02..3c2bfe759 100644 --- a/source/crud/write-operations/upsert.txt +++ b/source/crud/write-operations/upsert.txt @@ -1,3 +1,5 @@ +.. _java-upsert: + ====================================== Insert or Update in a Single Operation ====================================== diff --git a/source/data-formats/codecs.txt b/source/data-formats/codecs.txt index f82b09987..aa479a655 100644 --- a/source/data-formats/codecs.txt +++ b/source/data-formats/codecs.txt @@ -39,7 +39,7 @@ sections: - :ref:`Custom Codec Example ` If you are customizing encoding and decoding logic for plain old Java objects -(POJOs), read our guide on :doc:`POJO Customization `. +(POJOs), read our guide on :ref:`POJO Customization `. .. _codecs-codec: @@ -228,7 +228,7 @@ section of this guide. When working with POJOs, consider using the ``PojoCodecProvider`` to minimize duplicate code to convert commonly-used data types and customize their behavior. See our -:doc:`POJO Customization guide ` +:ref:`POJO Customization guide ` for more information. .. _codecs-default-codec-registry: diff --git a/source/data-formats/document-data-format-bson.txt b/source/data-formats/document-data-format-bson.txt index 6973ff8e0..b69a8e534 100644 --- a/source/data-formats/document-data-format-bson.txt +++ b/source/data-formats/document-data-format-bson.txt @@ -48,7 +48,7 @@ including: - `BasicDBObject <{+api+}/apidocs/mongodb-driver-core/com/mongodb/BasicDBObject.html>`__ (Java Driver package) For more information about using these object types, see our -:doc:`Documents guide `. +:ref:`Documents guide `. .. _install-bson-library: @@ -60,7 +60,7 @@ your project. If you added the MongoDB Java driver as a dependency to your project, you can skip this step since the BSON library is already included as a required dependency of the driver. For instructions on how to add the MongoDB Java driver as a dependency to your project, see the -:ref:`driver installation ` section of our Quick Start +:ref:`driver installation ` section of our Quick Start guide. We recommend that you use the `Maven `__ or diff --git a/source/data-formats/document-data-format-extended-json.txt b/source/data-formats/document-data-format-extended-json.txt index c0a1d3c6d..ae718e114 100644 --- a/source/data-formats/document-data-format-extended-json.txt +++ b/source/data-formats/document-data-format-extended-json.txt @@ -179,7 +179,7 @@ an example Extended JSON string into a ``Document`` object using the Document{{_id=507f1f77bcf86cd799439011, myNumber=4794261}} For more information, see our Fundamentals page -on :doc:`Documents `. +on :ref:`Documents `. Using the BSON Library ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/data-formats/documents.txt b/source/data-formats/documents.txt index 992b60c8d..a16405e74 100644 --- a/source/data-formats/documents.txt +++ b/source/data-formats/documents.txt @@ -106,7 +106,7 @@ frequently-used BSON and Java types: The preceding mapping table shows the default mapping when working with the ``Document`` class. You can customize the type mapping by specifying a custom codec. For more information about customizing mapped types, see our guide -on using :doc:`Codecs `. +on using :ref:`Codecs `. In the following code snippet, we show how to instantiate and build a sample ``Document`` instance representing a document containing several @@ -127,8 +127,8 @@ different field types: .append("yearPublished", 1985))); To insert this document into a collection, instantiate a collection -using the ``getCollection()`` method and call the :doc:`insertOne -` operation as follows: +using the ``getCollection()`` method and call the :ref:`insertOne +` operation as follows: .. code-block:: java @@ -177,7 +177,7 @@ The output of the preceding code resembles the following: title: Love in the Time of Cholera, yearPublished: 1985 For more information about retrieving and manipulating MongoDB data, see our -:doc:`CRUD guide `. +:ref:`CRUD guide `. For more information about the methods and classes mentioned in this section, see the following API Documentation: @@ -247,7 +247,7 @@ different field types: To insert this document into a collection, instantiate a collection using the ``getCollection()`` method specifying the ``BsonDocument`` class as the ``documentClass`` parameter. Then, call the -:doc:`insertOne ` operation as follows: +:ref:`insertOne ` operation as follows: .. code-block:: java @@ -317,9 +317,9 @@ By default, ``JsonObject`` stores :manual:`Extended JSON `. +our :ref:`Extended JSON guide `. For more information about specifying codecs, see our -:doc:`Codecs guide `. +:ref:`Codecs guide `. In the following code snippet, we show how to instantiate a sample ``JsonObject`` instance wrapping an Extended JSON string containing different types of key value pairs: @@ -338,7 +338,7 @@ instance wrapping an Extended JSON string containing different types of key valu To insert this document into a collection, instantiate a collection using the ``getCollection()`` method specifying the ``JsonObject`` class as the ``documentClass`` parameter. Then, call the -:doc:`insertOne ` operation as follows: +:ref:`insertOne ` operation as follows: .. code-block:: java @@ -472,7 +472,7 @@ different field types: To insert this document into a collection, instantiate a collection using the ``getCollection()`` method specifying the ``BasicDBObject`` class as the ``documentClass`` parameter. Then, call the -:doc:`insertOne ` operation as follows: +:ref:`insertOne ` operation as follows: .. code-block:: java diff --git a/source/data-formats/pojo-customization.txt b/source/data-formats/pojo-customization.txt index 06a646772..1cf4203d8 100644 --- a/source/data-formats/pojo-customization.txt +++ b/source/data-formats/pojo-customization.txt @@ -21,7 +21,7 @@ Overview -------- In this guide, you can learn how to define custom data conversions between -BSON and POJOs in the MongoDB Java driver. In our guide on :doc:`POJOs `, +BSON and POJOs in the MongoDB Java driver. In our guide on :ref:`POJOs `, we show how to specify a ``PojoCodecProvider`` which contains classes that provide instructions on how to convert data for one or more POJO classes and their properties. @@ -42,7 +42,7 @@ enums, generics, interface types, or abstract types, see the section on If you are using only the predefined behavior to convert data between BSON and POJOs, you can use the **automatic** setting for the -``PojoCodecProvider`` shown in the :doc:`Document Data Formats: POJOs guide `. +``PojoCodecProvider`` shown in the :ref:`Document Data Formats: POJOs guide `. Customize a PojoCodecProvider ----------------------------- diff --git a/source/data-formats/time-series.txt b/source/data-formats/time-series.txt index aaeb508f5..c46279be2 100644 --- a/source/data-formats/time-series.txt +++ b/source/data-formats/time-series.txt @@ -94,9 +94,9 @@ Your output should look similar to the following: Query a Time Series Collection ------------------------------ -To query in a time series collection, use the same conventions as you -would for :doc:`retrieving ` -and :ref:`aggregating data `. +To query in a time series collection, use the same conventions that you use for +:ref:`retrieving ` and :ref:`aggregating data +`. .. note:: Window Functions diff --git a/source/get-started/connect-to-mongodb.txt b/source/get-started/connect-to-mongodb.txt index 63c215b95..287892833 100644 --- a/source/get-started/connect-to-mongodb.txt +++ b/source/get-started/connect-to-mongodb.txt @@ -1,5 +1,3 @@ -.. _java-connect-to-mongodb: - ================== Connect to MongoDB ================== diff --git a/source/includes/fundamentals-sections.rst b/source/includes/fundamentals-sections.rst deleted file mode 100644 index d8efa7e76..000000000 --- a/source/includes/fundamentals-sections.rst +++ /dev/null @@ -1,18 +0,0 @@ -Learn how to perform the following tasks using the Java driver in the -Fundamentals section: - -- :doc:`Connect to MongoDB ` -- :doc:`Use the Stable API ` -- :doc:`Authenticate with MongoDB ` -- :doc:`Convert between MongoDB Data Formats and Java Objects ` -- :doc:`Read from and Write to MongoDB ` -- :doc:`Simplify your Code with Builders ` -- :doc:`Transform your Data ` -- :doc:`Create Aggregation Expressions ` -- :doc:`Create Indexes to Speed Up Queries ` -- :doc:`Sort Using Collations ` -- :doc:`Log Events in the Driver ` -- :doc:`Monitor Driver Events ` -- :doc:`Store and Retrieve Large Files in MongoDB ` -- :doc:`Encrypt Fields in a Document ` -- :doc:`Use a Time Series Collection ` diff --git a/source/index.txt b/source/index.txt index b382ca05b..06b623cd3 100644 --- a/source/index.txt +++ b/source/index.txt @@ -59,29 +59,12 @@ Get Started Learn how to establish a connection to MongoDB Atlas and begin working with data in the :ref:`Get Started ` section. -Quick Reference ---------------- - -See driver syntax examples for common MongoDB commands in the -:ref:`Quick Reference ` section. - What's New ---------- For a list of new features and changes in each version, see the :ref:`What's New ` section. -Usage Examples --------------- - -For fully runnable code snippets and explanations for common -methods, see the :doc:`Usage Examples ` section. - -Fundamentals ------------- - -.. include:: /includes/fundamentals-sections.rst - API Documentation ----------------- @@ -125,14 +108,14 @@ Issues & Help Learn how to report bugs, contribute to the driver, and find additional resources for asking questions and receiving help in the -:doc:`Issues & Help ` section. +:ref:`Issues & Help ` section. Compatibility ------------- For the compatibility charts that show the recommended Java Driver version for each {+mdb-server+} version, see the -:doc:`Compatibility ` section. +:ref:`Compatibility ` section. Upgrade Driver Versions ----------------------- diff --git a/source/logging-monitoring/logging.txt b/source/logging-monitoring/logging.txt index 21a2fe7e1..3bd5bc7af 100644 --- a/source/logging-monitoring/logging.txt +++ b/source/logging-monitoring/logging.txt @@ -38,7 +38,7 @@ You will learn how to: This guide shows how to record events in the driver. If you would like to learn how to use information about the activity of the driver in code, consider reading our -:doc:`guide on monitoring `. +:ref:`guide on monitoring `. Set Up a Logger --------------- diff --git a/source/logging-monitoring/monitoring.txt b/source/logging-monitoring/monitoring.txt index cf958eb19..bd4137f88 100644 --- a/source/logging-monitoring/monitoring.txt +++ b/source/logging-monitoring/monitoring.txt @@ -1,3 +1,5 @@ +.. _java-monitoring: + ========== Monitoring ========== diff --git a/source/usage-examples.txt b/source/usage-examples.txt deleted file mode 100644 index 489e71b86..000000000 --- a/source/usage-examples.txt +++ /dev/null @@ -1,72 +0,0 @@ -============== -Usage Examples -============== - - - -.. contents:: On this page - :local: - :backlinks: none - :depth: 1 - :class: singlecol - -.. toctree:: - - Find - Insert - Update & Replace - Delete - Bulk Operations - Watch for Changes - Count Documents - Distinct Field Values - Run a Command - -Overview --------- - -Usage examples provide convenient starting points for popular MongoDB -operations. Each example provides the following information: - -- An explanation of the operation in the example showing the - purpose and a sample use case for the method - -- An explanation of how to use the operation, including parameters, - return values, and common exceptions you might encounter - -- A full Java class that you can copy and paste to run the example - in your own environment - -How to Use the Usage Examples ------------------------------ - -These examples use the :atlas:`sample datasets ` -provided by Atlas. You can load them into your database on the free tier of -MongoDB Atlas by following the -:atlas:`Get Started with Atlas Guide ` -or you can -:guides:`import the sample dataset into a local MongoDB instance -`. - -Once you have imported the dataset, you can copy and paste a usage -example into your development environment of choice. You can follow the -:ref:`Get Started ` tutorial to learn more about getting -started with the MongoDB Java driver. Once you've copied a usage example, -you must edit the connection URI to get the example connected to -your MongoDB instance: - -.. code-block:: java - - // Replace the following with your MongoDB deployment's connection string. - String uri = ""; - -You can use the :guides:`Atlas Connectivity Guide ` -to learn how to allow connections to your instance of Atlas and to find the -:manual:`connection string ` you use to replace the -``uri`` variable in usage examples. If your instance uses -:manual:`SCRAM authentication `, you can replace -```` with your database username, ```` with your database password, and -```` with the IP address or URL of your instance. - -For more information about connecting to your MongoDB instance, see our -:doc:`Connection Guide `. diff --git a/source/usage-examples/updateMany.txt b/source/usage-examples/updateMany.txt index d080214f8..cbdc791dd 100644 --- a/source/usage-examples/updateMany.txt +++ b/source/usage-examples/updateMany.txt @@ -70,7 +70,7 @@ We use the ``Updates`` builder, a factory class that contains static helper methods to construct the update document. While you can pass an update document instead of using the builder, the builder provides type checking and simplified syntax. Read our -:doc:`guide on Updates ` in the Builders +:ref:`guide on Updates ` in the Builders section for more information. .. include:: /includes/connect-guide-note.rst diff --git a/source/usage-examples/updateOne.txt b/source/usage-examples/updateOne.txt index 29ba94099..8aba7942d 100644 --- a/source/usage-examples/updateOne.txt +++ b/source/usage-examples/updateOne.txt @@ -69,7 +69,7 @@ We use the ``Updates`` builder, a factory class that contains static helper methods, to construct the update document. While you can pass an update document instead of using the builder, the builder provides type checking and simplified syntax. For more information about the ``Updates`` builder, see our -:doc:`guide on the Updates builder `. +:ref:`guide about Updates `. .. include:: /includes/connect-guide-note.rst