From 960158e7895a32b9ce4da7107e1b002a12de9c78 Mon Sep 17 00:00:00 2001 From: Rea Rustagi <85902999+rustagir@users.noreply.github.com> Date: Wed, 26 Mar 2025 16:28:28 -0400 Subject: [PATCH 01/13] use sharedincludes --- source/compatibility.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/compatibility.txt b/source/compatibility.txt index 57f71dda..b6ff89dc 100644 --- a/source/compatibility.txt +++ b/source/compatibility.txt @@ -10,7 +10,6 @@ Compatibility :depth: 2 :class: singlecol - MongoDB Compatibility --------------------- @@ -23,7 +22,7 @@ The first column lists the driver version. .. sharedinclude:: dbx/compatibility-table-legend.rst -.. include:: /includes/mongodb-compatibility-table-kotlin.rst +.. sharedinclude:: dbx/mongodb-compatibility-table-kotlin.rst Language Compatibility ---------------------- @@ -33,7 +32,7 @@ of the {+driver-long+} for use with a specific version of Kotlin. The first column lists the driver version. -.. include:: /includes/language-compatibility-table-kotlin.rst +.. sharedinclude:: dbx/language-compatibility-table-kotlin.rst For more information on how to read the compatibility tables, see our guide on :ref:`MongoDB Compatibility Tables `. From f0276060cc59be53a5bcbad2ba8a76d7b770f751 Mon Sep 17 00:00:00 2001 From: Mike Woofter <108414937+mongoKart@users.noreply.github.com> Date: Thu, 27 Mar 2025 11:55:31 -0500 Subject: [PATCH 02/13] DOCSP-48687 - Standardize API source constants (#207) (cherry picked from commit 325655739805248c5fd43a70192f3c8cd9b7b03e) --- snooty.toml | 4 +- source/api-documentation.txt | 20 +- .../aggregation-expression-operations.txt | 278 +++++++++--------- source/fundamentals/aggregation.txt | 22 +- source/fundamentals/auth.txt | 16 +- source/fundamentals/builders/aggregates.txt | 34 +-- .../builders/builders-data-classes.txt | 2 +- source/fundamentals/builders/filters.txt | 70 ++--- source/fundamentals/builders/indexes.txt | 18 +- source/fundamentals/builders/projections.txt | 2 +- source/fundamentals/builders/sort.txt | 10 +- source/fundamentals/builders/updates.txt | 40 +-- .../fundamentals/builders/vector-search.txt | 8 +- source/fundamentals/collations.txt | 56 ++-- .../connection/connection-options.txt | 4 +- .../connection/mongoclientsettings.txt | 14 +- .../connection/network-compression.txt | 8 +- source/fundamentals/connection/socks5.txt | 8 +- source/fundamentals/connection/tls.txt | 8 +- .../fundamentals/crud/compound-operations.txt | 16 +- .../crud/read-operations/change-streams.txt | 10 +- .../crud/read-operations/flow.txt | 10 +- .../fundamentals/crud/read-operations/geo.txt | 2 +- .../crud/read-operations/limit.txt | 4 +- .../crud/read-operations/retrieve.txt | 4 +- .../crud/read-operations/skip.txt | 4 +- .../crud/read-operations/sort.txt | 22 +- .../crud/read-operations/text.txt | 4 +- .../crud/write-operations/bulk.txt | 40 +-- .../crud/write-operations/delete.txt | 10 +- .../crud/write-operations/embedded-arrays.txt | 6 +- .../crud/write-operations/insert.txt | 8 +- .../crud/write-operations/modify.txt | 12 +- .../crud/write-operations/upsert.txt | 4 +- source/fundamentals/data-formats/codecs.txt | 32 +- .../document-data-format-bson.txt | 10 +- .../document-data-format-data-class.txt | 2 +- .../document-data-format-extended-json.txt | 14 +- .../fundamentals/data-formats/documents.txt | 24 +- .../data-formats/serialization.txt | 14 +- source/fundamentals/databases-collections.txt | 32 +- source/fundamentals/enterprise-auth.txt | 10 +- source/fundamentals/indexes.txt | 22 +- source/fundamentals/monitoring.txt | 38 +-- source/fundamentals/stable-api.txt | 20 +- source/fundamentals/time-series.txt | 8 +- source/fundamentals/transactions.txt | 10 +- source/includes/fundamentals/auth-specify.rst | 8 +- source/index.txt | 8 +- source/migrate-kmongo.txt | 2 +- source/quick-reference.txt | 42 +-- source/quick-start.txt | 2 +- source/usage-examples/bulkWrite.txt | 18 +- source/usage-examples/command.txt | 2 +- source/usage-examples/count.txt | 8 +- source/usage-examples/deleteMany.txt | 6 +- source/usage-examples/deleteOne.txt | 6 +- source/usage-examples/distinct.txt | 4 +- source/usage-examples/find.txt | 4 +- source/usage-examples/findOne.txt | 4 +- source/usage-examples/insertMany.txt | 6 +- source/usage-examples/insertOne.txt | 6 +- source/usage-examples/replaceOne.txt | 8 +- source/usage-examples/updateMany.txt | 12 +- source/usage-examples/updateOne.txt | 14 +- source/usage-examples/watch.txt | 8 +- source/whats-new.txt | 24 +- 67 files changed, 604 insertions(+), 602 deletions(-) diff --git a/snooty.toml b/snooty.toml index f2a75ebf..c117c58e 100644 --- a/snooty.toml +++ b/snooty.toml @@ -27,7 +27,9 @@ mdb-server = "MongoDB server" kotlin-docs = "https://kotlinlang.org" package-name-org = "mongodb-org" -api = "https://mongodb.github.io/mongo-java-driver/{+version+}" +api-root = "https://mongodb.github.io/mongo-java-driver/{+version+}/apidocs" +core-api = "{+api-root+}/mongodb-driver-core/com/mongodb" +driver-api = "{+api-root+}/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine" stable-api = "Stable API" mongocrypt-version = "{+full-version+}" nettyVersion = "io.netty:netty-all:4.1.79.Final" diff --git a/source/api-documentation.txt b/source/api-documentation.txt index 6a83a4cd..c0211098 100644 --- a/source/api-documentation.txt +++ b/source/api-documentation.txt @@ -6,22 +6,22 @@ API Documentation :titlesonly: :maxdepth: 1 - BSON kotlinx.serialization <{+api+}/apidocs/bson-kotlinx/index.html> - {+language+} Driver Extensions <{+api+}/apidocs/mongodb-driver-kotlin-extensions/index.html> - Driver Core <{+api+}/apidocs/mongodb-driver-core/index.html> - {+language+} Coroutine Driver <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/index.html> - {+language+} Sync Driver <{+api+}/apidocs/mongodb-driver-kotlin-sync/index.html> + BSON kotlinx.serialization <{+api-root+}/bson-kotlinx/index.html> + {+language+} Driver Extensions <{+api-root+}/mongodb-driver-kotlin-extensions/index.html> + Driver Core <{+api-root+}/mongodb-driver-core/index.html> + {+language+} Coroutine Driver <{+api-root+}/mongodb-driver-kotlin-coroutine/index.html> + {+language+} Sync Driver <{+api-root+}/mongodb-driver-kotlin-sync/index.html> -- `BSON kotlinx.serialization <{+api+}/apidocs/bson-kotlinx/index.html>`__ - +- `BSON kotlinx.serialization <{+api-root+}/bson-kotlinx/index.html>`__ - classes for encoding and decoding between Kotlin data classes and the BSON data format using :github:`kotlinx.serialization `. - `{+language+} Driver Extensions - <{+api+}/apidocs/mongodb-driver-kotlin-extensions/index.html>`__ - + <{+api-root+}/mongodb-driver-kotlin-extensions/index.html>`__ - classes that extend the core builder classes to support :ref:`data classes `. -- `Driver Core <{+api+}/apidocs/mongodb-driver-core/index.html>`__ - classes that +- `Driver Core <{+api-root+}/mongodb-driver-core/index.html>`__ - classes that contain essential driver functionality. -- `{+language+} Coroutine Driver <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/index.html>`__ - +- `{+language+} Coroutine Driver <{+api-root+}/mongodb-driver-kotlin-coroutine/index.html>`__ - classes for the current driver API using coroutines. -- `{+language+} Sync Driver <{+api+}/apidocs/mongodb-driver-kotlin-sync/index.html>`__ - +- `{+language+} Sync Driver <{+api-root+}/mongodb-driver-kotlin-sync/index.html>`__ - classes for the current synchronous driver API. diff --git a/source/fundamentals/aggregation-expression-operations.txt b/source/fundamentals/aggregation-expression-operations.txt index d8d6ad9d..c3e7c87f 100644 --- a/source/fundamentals/aggregation-expression-operations.txt +++ b/source/fundamentals/aggregation-expression-operations.txt @@ -21,7 +21,7 @@ pattern, you can chain aggregation operations together to create code that is both more compact and more naturally readable. The operations in this guide use methods from the -`com.mongodb.client.model.mql <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/package-summary.html>`__ package. +`com.mongodb.client.model.mql <{+core-api+}/client/model/mql/package-summary.html>`__ package. These methods provide an idiomatic way to use the Query API, the mechanism by which the driver interacts with a MongoDB deployment. To learn more about the Query API, see the :manual:`Server manual documentation `. @@ -124,41 +124,41 @@ expressions. * - Method - Description - * - `current() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#current()>`__ + * - `current() <{+core-api+}/client/model/mql/MqlValues.html#current()>`__ - References the current document being processed by the aggregation pipeline. - * - `currentAsMap() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#currentAsMap()>`__ + * - `currentAsMap() <{+core-api+}/client/model/mql/MqlValues.html#currentAsMap()>`__ - References the current document being processed by the aggregation pipeline as a map value. - * - | `of() for MqlBoolean <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#of(boolean)>`__ - | `of() for MqlNumber (double) <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#of(double)>`__ - | `of() for MqlNumber (Decimal128) <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#of(org.bson.types.Decimal128)>`__ - | `of() for MqlInteger (int) <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#of(int)>`__ - | `of() for MqlInteger (long) <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#of(long)>`__ - | `of() for MqlString <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#of(java.lang.String)>`__ - | `of() for MqlDate <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#of(java.time.Instant)>`__ - | `of() for MqlDocument <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#of(org.bson.conversions.Bson)>`__ + * - | `of() for MqlBoolean <{+core-api+}/client/model/mql/MqlValues.html#of(boolean)>`__ + | `of() for MqlNumber (double) <{+core-api+}/client/model/mql/MqlValues.html#of(double)>`__ + | `of() for MqlNumber (Decimal128) <{+core-api+}/client/model/mql/MqlValues.html#of(org.bson.types.Decimal128)>`__ + | `of() for MqlInteger (int) <{+core-api+}/client/model/mql/MqlValues.html#of(int)>`__ + | `of() for MqlInteger (long) <{+core-api+}/client/model/mql/MqlValues.html#of(long)>`__ + | `of() for MqlString <{+core-api+}/client/model/mql/MqlValues.html#of(java.lang.String)>`__ + | `of() for MqlDate <{+core-api+}/client/model/mql/MqlValues.html#of(java.time.Instant)>`__ + | `of() for MqlDocument <{+core-api+}/client/model/mql/MqlValues.html#of(org.bson.conversions.Bson)>`__ - Returns an ``MqlValue`` type corresponding to the provided primitive. - * - `ofArray() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#ofArray(T...)>`__ + * - `ofArray() <{+core-api+}/client/model/mql/MqlValues.html#ofArray(T...)>`__ | **Typed Variants**: - | `ofBooleanArray() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#ofBooleanArray(boolean...)>`__ - | `ofDateArray() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#ofDateArray(java.time.Instant...)>`__ - | `ofIntegerArray() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#ofIntegerArray(int...)>`__ - | `ofNumberArray() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#ofNumberArray(double...)>`__ - | `ofStringArray() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#ofStringArray(java.lang.String...)>`__ + | `ofBooleanArray() <{+core-api+}/client/model/mql/MqlValues.html#ofBooleanArray(boolean...)>`__ + | `ofDateArray() <{+core-api+}/client/model/mql/MqlValues.html#ofDateArray(java.time.Instant...)>`__ + | `ofIntegerArray() <{+core-api+}/client/model/mql/MqlValues.html#ofIntegerArray(int...)>`__ + | `ofNumberArray() <{+core-api+}/client/model/mql/MqlValues.html#ofNumberArray(double...)>`__ + | `ofStringArray() <{+core-api+}/client/model/mql/MqlValues.html#ofStringArray(java.lang.String...)>`__ - Returns an array of ``MqlValue`` types corresponding to the provided array of primitives. - * - `ofEntry() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#ofEntry(com.mongodb.client.model.mql.MqlString,T)>`__ + * - `ofEntry() <{+core-api+}/client/model/mql/MqlValues.html#ofEntry(com.mongodb.client.model.mql.MqlString,T)>`__ - Returns an entry value. - * - `ofMap() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#ofMap()>`__ + * - `ofMap() <{+core-api+}/client/model/mql/MqlValues.html#ofMap()>`__ - Returns an empty map value. - * - `ofNull() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValues.html#ofNull()>`__ + * - `ofNull() <{+core-api+}/client/model/mql/MqlValues.html#ofNull()>`__ - Returns the null value as exists in the Query API. .. important:: @@ -212,29 +212,29 @@ You can perform an arithmetic operation on a value of type ``MqlInteger`` or * - Method - Aggregation Pipeline Operator - * - | `abs() for MqlInteger <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlInteger.html#abs()>`__ - | `abs() for MqlNumber <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlNumber.html#abs()>`__ + * - | `abs() for MqlInteger <{+core-api+}/client/model/mql/MqlInteger.html#abs()>`__ + | `abs() for MqlNumber <{+core-api+}/client/model/mql/MqlNumber.html#abs()>`__ - :manual:`$abs ` - * - | `add() for MqlInteger <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlInteger.html#add(int)>`__ - | `add() for MqlNumber <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlNumber.html#add(com.mongodb.client.model.mql.MqlNumber)>`__ + * - | `add() for MqlInteger <{+core-api+}/client/model/mql/MqlInteger.html#add(int)>`__ + | `add() for MqlNumber <{+core-api+}/client/model/mql/MqlNumber.html#add(com.mongodb.client.model.mql.MqlNumber)>`__ - :manual:`$add ` - * - `divide() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlNumber.html#divide(com.mongodb.client.model.mql.MqlNumber)>`__ + * - `divide() <{+core-api+}/client/model/mql/MqlNumber.html#divide(com.mongodb.client.model.mql.MqlNumber)>`__ - :manual:`$divide ` - * - | `multiply() for MqlInteger <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlInteger.html#multiply(int)>`__ - | `multiply() for MqlNumber <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlNumber.html#multiply(com.mongodb.client.model.mql.MqlNumber)>`__ + * - | `multiply() for MqlInteger <{+core-api+}/client/model/mql/MqlInteger.html#multiply(int)>`__ + | `multiply() for MqlNumber <{+core-api+}/client/model/mql/MqlNumber.html#multiply(com.mongodb.client.model.mql.MqlNumber)>`__ - :manual:`$multiply ` - * - `round() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlNumber.html#round()>`__ + * - `round() <{+core-api+}/client/model/mql/MqlNumber.html#round()>`__ - :manual:`$round ` - * - | `subtract() for MqlInteger <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlInteger.html#subtract(int)>`__ - | `subtract() for MqlNumber <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlNumber.html#subtract(com.mongodb.client.model.mql.MqlNumber)>`__ + * - | `subtract() for MqlInteger <{+core-api+}/client/model/mql/MqlInteger.html#subtract(int)>`__ + | `subtract() for MqlNumber <{+core-api+}/client/model/mql/MqlNumber.html#subtract(com.mongodb.client.model.mql.MqlNumber)>`__ - :manual:`$subtract ` @@ -277,70 +277,70 @@ using the methods described in this section. * - Method - Aggregation Pipeline Operator - * - `all() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#all(java.util.function.Function)>`__ + * - `all() <{+core-api+}/client/model/mql/MqlArray.html#all(java.util.function.Function)>`__ - :manual:`$allElementsTrue ` - * - `any() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#any(java.util.function.Function)>`__ + * - `any() <{+core-api+}/client/model/mql/MqlArray.html#any(java.util.function.Function)>`__ - :manual:`$anyElementTrue ` - * - `concat() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#concat(com.mongodb.client.model.mql.MqlArray)>`__ + * - `concat() <{+core-api+}/client/model/mql/MqlArray.html#concat(com.mongodb.client.model.mql.MqlArray)>`__ - :manual:`$concatArrays ` - * - `concatArrays() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#concatArrays(java.util.function.Function)>`__ + * - `concatArrays() <{+core-api+}/client/model/mql/MqlArray.html#concatArrays(java.util.function.Function)>`__ - :manual:`$concatArrays ` - * - `contains() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#contains(T)>`__ + * - `contains() <{+core-api+}/client/model/mql/MqlArray.html#contains(T)>`__ - :manual:`$in ` - * - `distinct() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#distinct()>`__ + * - `distinct() <{+core-api+}/client/model/mql/MqlArray.html#distinct()>`__ - :manual:`$setUnion ` - * - `elementAt() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#elementAt(int)>`__ + * - `elementAt() <{+core-api+}/client/model/mql/MqlArray.html#elementAt(int)>`__ - :manual:`$arrayElemAt ` - * - `filter() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#filter(java.util.function.Function)>`__ + * - `filter() <{+core-api+}/client/model/mql/MqlArray.html#filter(java.util.function.Function)>`__ - :manual:`$filter ` - * - `first() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#first()>`__ + * - `first() <{+core-api+}/client/model/mql/MqlArray.html#first()>`__ - :manual:`$first ` - * - `joinStrings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#joinStrings(java.util.function.Function)>`__ + * - `joinStrings() <{+core-api+}/client/model/mql/MqlArray.html#joinStrings(java.util.function.Function)>`__ - :manual:`$concat ` - * - `last() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#last()>`__ + * - `last() <{+core-api+}/client/model/mql/MqlArray.html#last()>`__ - :manual:`$last ` - * - `map() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#map(java.util.function.Function)>`__ + * - `map() <{+core-api+}/client/model/mql/MqlArray.html#map(java.util.function.Function)>`__ - :manual:`$map ` - * - `max() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#max(T)>`__ + * - `max() <{+core-api+}/client/model/mql/MqlArray.html#max(T)>`__ - :manual:`$max ` - * - `maxN() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#maxN(com.mongodb.client.model.mql.MqlInteger)>`__ + * - `maxN() <{+core-api+}/client/model/mql/MqlArray.html#maxN(com.mongodb.client.model.mql.MqlInteger)>`__ - :manual:`$maxN ` - * - `min() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#min(T)>`__ + * - `min() <{+core-api+}/client/model/mql/MqlArray.html#min(T)>`__ - :manual:`$min ` - * - `minN() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#minN(com.mongodb.client.model.mql.MqlInteger)>`__ + * - `minN() <{+core-api+}/client/model/mql/MqlArray.html#minN(com.mongodb.client.model.mql.MqlInteger)>`__ - :manual:`$minN ` - * - `multiply() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#multiply(java.util.function.Function)>`__ + * - `multiply() <{+core-api+}/client/model/mql/MqlArray.html#multiply(java.util.function.Function)>`__ - :manual:`$multiply ` - * - `size() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#size()>`__ + * - `size() <{+core-api+}/client/model/mql/MqlArray.html#size()>`__ - :manual:`$size ` - * - `slice() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#slice(int,int)>`__ + * - `slice() <{+core-api+}/client/model/mql/MqlArray.html#slice(int,int)>`__ - :manual:`$slice ` - * - `sum() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#sum(java.util.function.Function)>`__ + * - `sum() <{+core-api+}/client/model/mql/MqlArray.html#sum(java.util.function.Function)>`__ - :manual:`$sum ` - * - `union() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#union(com.mongodb.client.model.mql.MqlArray)>`__ + * - `union() <{+core-api+}/client/model/mql/MqlArray.html#union(com.mongodb.client.model.mql.MqlArray)>`__ - :manual:`$setUnion ` - * - `unionArrays() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#unionArrays(java.util.function.Function)>`__ + * - `unionArrays() <{+core-api+}/client/model/mql/MqlArray.html#unionArrays(java.util.function.Function)>`__ - :manual:`$setUnion ` Suppose you have a collection of movies, each of which contains an array @@ -427,13 +427,13 @@ using the methods described in this section. * - Method - Aggregation Pipeline Operator - * - `and() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlBoolean.html#and(com.mongodb.client.model.mql.MqlBoolean)>`__ + * - `and() <{+core-api+}/client/model/mql/MqlBoolean.html#and(com.mongodb.client.model.mql.MqlBoolean)>`__ - :manual:`$and ` - * - `not() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlBoolean.html#not()>`__ + * - `not() <{+core-api+}/client/model/mql/MqlBoolean.html#not()>`__ - :manual:`$not ` - * - `or() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlBoolean.html#or(com.mongodb.client.model.mql.MqlBoolean)>`__ + * - `or() <{+core-api+}/client/model/mql/MqlBoolean.html#or(com.mongodb.client.model.mql.MqlBoolean)>`__ - :manual:`$or ` Suppose you want to classify very low or high weather temperature @@ -479,32 +479,32 @@ using the methods described in this section. * - Method - Aggregation Pipeline Operator - * - `eq() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#eq(com.mongodb.client.model.mql.MqlValue)>`__ + * - `eq() <{+core-api+}/client/model/mql/MqlValue.html#eq(com.mongodb.client.model.mql.MqlValue)>`__ - :manual:`$eq ` - * - `gt() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#gt(com.mongodb.client.model.mql.MqlValue)>`__ + * - `gt() <{+core-api+}/client/model/mql/MqlValue.html#gt(com.mongodb.client.model.mql.MqlValue)>`__ - :manual:`$gt ` - * - `gte() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#gte(com.mongodb.client.model.mql.MqlValue)>`__ + * - `gte() <{+core-api+}/client/model/mql/MqlValue.html#gte(com.mongodb.client.model.mql.MqlValue)>`__ - :manual:`$gte ` - * - `lt() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#lt(com.mongodb.client.model.mql.MqlValue)>`__ + * - `lt() <{+core-api+}/client/model/mql/MqlValue.html#lt(com.mongodb.client.model.mql.MqlValue)>`__ - :manual:`$lt ` - * - `lte() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#lte(com.mongodb.client.model.mql.MqlValue)>`__ + * - `lte() <{+core-api+}/client/model/mql/MqlValue.html#lte(com.mongodb.client.model.mql.MqlValue)>`__ - :manual:`$lte ` - * - | `max() for MqlInteger <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlInteger.html#max(com.mongodb.client.model.mql.MqlInteger)>`__ - | `max() for MqlNumber <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlNumber.html#max(com.mongodb.client.model.mql.MqlNumber)>`__ + * - | `max() for MqlInteger <{+core-api+}/client/model/mql/MqlInteger.html#max(com.mongodb.client.model.mql.MqlInteger)>`__ + | `max() for MqlNumber <{+core-api+}/client/model/mql/MqlNumber.html#max(com.mongodb.client.model.mql.MqlNumber)>`__ - :manual:`$max ` - * - | `min() for MqlInteger <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlInteger.html#min(com.mongodb.client.model.mql.MqlInteger)>`__ - | `min() for MqlNumber <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlNumber.html#min(com.mongodb.client.model.mql.MqlNumber)>`__ + * - | `min() for MqlInteger <{+core-api+}/client/model/mql/MqlInteger.html#min(com.mongodb.client.model.mql.MqlInteger)>`__ + | `min() for MqlNumber <{+core-api+}/client/model/mql/MqlNumber.html#min(com.mongodb.client.model.mql.MqlNumber)>`__ - :manual:`$min ` - * - `ne() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#ne(com.mongodb.client.model.mql.MqlValue)>`__ + * - `ne() <{+core-api+}/client/model/mql/MqlValue.html#ne(com.mongodb.client.model.mql.MqlValue)>`__ - :manual:`$ne ` The following example shows a pipeline that matches all the documents @@ -534,20 +534,20 @@ this section. * - Method - Aggregation Pipeline Operator - * - `cond() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlBoolean.html#cond(T,T)>`__ + * - `cond() <{+core-api+}/client/model/mql/MqlBoolean.html#cond(T,T)>`__ - :manual:`$cond ` - * - `switchOn() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#switchOn(java.util.function.Function)>`__ + * - `switchOn() <{+core-api+}/client/model/mql/MqlValue.html#switchOn(java.util.function.Function)>`__ | **Typed Variants**: - | `switchArrayOn() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#switchArrayOn(java.util.function.Function)>`__ - | `switchBooleanOn() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlBoolean.html#switchBooleanOn(java.util.function.Function)>`__ - | `switchDateOn() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDate.html#switchDateOn(java.util.function.Function)>`__ - | `switchDocumentOn() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#switchDocumentOn(java.util.function.Function)>`__ - | `switchIntegerOn() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlInteger.html#switchIntegerOn(java.util.function.Function)>`__ - | `switchMapOn() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlMap.html#switchMapOn(java.util.function.Function)>`__ - | `switchNumberOn() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlNumber.html#switchNumberOn(java.util.function.Function)>`__ - | `switchStringOn() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlString.html#switchStringOn(java.util.function.Function)>`__ + | `switchArrayOn() <{+core-api+}/client/model/mql/MqlArray.html#switchArrayOn(java.util.function.Function)>`__ + | `switchBooleanOn() <{+core-api+}/client/model/mql/MqlBoolean.html#switchBooleanOn(java.util.function.Function)>`__ + | `switchDateOn() <{+core-api+}/client/model/mql/MqlDate.html#switchDateOn(java.util.function.Function)>`__ + | `switchDocumentOn() <{+core-api+}/client/model/mql/MqlDocument.html#switchDocumentOn(java.util.function.Function)>`__ + | `switchIntegerOn() <{+core-api+}/client/model/mql/MqlInteger.html#switchIntegerOn(java.util.function.Function)>`__ + | `switchMapOn() <{+core-api+}/client/model/mql/MqlMap.html#switchMapOn(java.util.function.Function)>`__ + | `switchNumberOn() <{+core-api+}/client/model/mql/MqlNumber.html#switchNumberOn(java.util.function.Function)>`__ + | `switchStringOn() <{+core-api+}/client/model/mql/MqlString.html#switchStringOn(java.util.function.Function)>`__ - :manual:`$switch ` @@ -609,17 +609,17 @@ into custom static methods. * - Method - Aggregation Pipeline Operator - * - `passTo() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#passTo(java.util.function.Function)>`__ + * - `passTo() <{+core-api+}/client/model/mql/MqlValue.html#passTo(java.util.function.Function)>`__ | **Typed Variants**: - | `passArrayTo() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlArray.html#passArrayTo(java.util.function.Function)>`__ - | `passBooleanTo() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlBoolean.html#passBooleanTo(java.util.function.Function)>`__ - | `passDateTo() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDate.html#passDateTo(java.util.function.Function)>`__ - | `passDocumentTo() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#passDocumentTo(java.util.function.Function)>`__ - | `passIntegerTo() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlInteger.html#passIntegerTo(java.util.function.Function)>`__ - | `passMapTo() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlMap.html#passMapTo(java.util.function.Function)>`__ - | `passNumberTo() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlNumber.html#passNumberTo(java.util.function.Function)>`__ - | `passStringTo() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlString.html#passStringTo(java.util.function.Function)>`__ + | `passArrayTo() <{+core-api+}/client/model/mql/MqlArray.html#passArrayTo(java.util.function.Function)>`__ + | `passBooleanTo() <{+core-api+}/client/model/mql/MqlBoolean.html#passBooleanTo(java.util.function.Function)>`__ + | `passDateTo() <{+core-api+}/client/model/mql/MqlDate.html#passDateTo(java.util.function.Function)>`__ + | `passDocumentTo() <{+core-api+}/client/model/mql/MqlDocument.html#passDocumentTo(java.util.function.Function)>`__ + | `passIntegerTo() <{+core-api+}/client/model/mql/MqlInteger.html#passIntegerTo(java.util.function.Function)>`__ + | `passMapTo() <{+core-api+}/client/model/mql/MqlMap.html#passMapTo(java.util.function.Function)>`__ + | `passNumberTo() <{+core-api+}/client/model/mql/MqlNumber.html#passNumberTo(java.util.function.Function)>`__ + | `passStringTo() <{+core-api+}/client/model/mql/MqlString.html#passStringTo(java.util.function.Function)>`__ - *No corresponding operator* @@ -691,25 +691,25 @@ types using the methods described in this section. * - Method - Aggregation Pipeline Operator - * - `asDocument() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlMap.html#asDocument()>`__ + * - `asDocument() <{+core-api+}/client/model/mql/MqlMap.html#asDocument()>`__ - *No corresponding operator* - * - `asMap() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#asMap()>`__ + * - `asMap() <{+core-api+}/client/model/mql/MqlDocument.html#asMap()>`__ - *No corresponding operator* - * - `asString() for MqlDate <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDate.html#asString(com.mongodb.client.model.mql.MqlString,com.mongodb.client.model.mql.MqlString)>`__ + * - `asString() for MqlDate <{+core-api+}/client/model/mql/MqlDate.html#asString(com.mongodb.client.model.mql.MqlString,com.mongodb.client.model.mql.MqlString)>`__ - :manual:`$dateToString ` - * - `asString() for MqlValue <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#asString()>`__ + * - `asString() for MqlValue <{+core-api+}/client/model/mql/MqlValue.html#asString()>`__ - :manual:`$toString ` - * - `millisecondsAsDate() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlInteger.html#millisecondsAsDate()>`__ + * - `millisecondsAsDate() <{+core-api+}/client/model/mql/MqlInteger.html#millisecondsAsDate()>`__ - :manual:`$toDate ` - * - `parseDate() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlString.html#parseDate()>`__ + * - `parseDate() <{+core-api+}/client/model/mql/MqlString.html#parseDate()>`__ - :manual:`$dateFromString ` - * - `parseInteger() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlString.html#parseInteger()>`__ + * - `parseInteger() <{+core-api+}/client/model/mql/MqlString.html#parseInteger()>`__ - :manual:`$toInt ` Suppose you want to have a collection of student data that includes @@ -750,34 +750,34 @@ using the methods described in this section. * - Method - Aggregation Pipeline Operator - * - `dayOfMonth() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDate.html#dayOfMonth(com.mongodb.client.model.mql.MqlString)>`__ + * - `dayOfMonth() <{+core-api+}/client/model/mql/MqlDate.html#dayOfMonth(com.mongodb.client.model.mql.MqlString)>`__ - :manual:`$dayOfMonth ` - * - `dayOfWeek() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDate.html#dayOfWeek(com.mongodb.client.model.mql.MqlString)>`__ + * - `dayOfWeek() <{+core-api+}/client/model/mql/MqlDate.html#dayOfWeek(com.mongodb.client.model.mql.MqlString)>`__ - :manual:`$dayOfWeek ` - * - `dayOfYear() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDate.html#dayOfYear(com.mongodb.client.model.mql.MqlString)>`__ + * - `dayOfYear() <{+core-api+}/client/model/mql/MqlDate.html#dayOfYear(com.mongodb.client.model.mql.MqlString)>`__ - :manual:`$dayOfYear ` - * - `hour() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDate.html#hour(com.mongodb.client.model.mql.MqlString)>`__ + * - `hour() <{+core-api+}/client/model/mql/MqlDate.html#hour(com.mongodb.client.model.mql.MqlString)>`__ - :manual:`$hour ` - * - `millisecond() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDate.html#millisecond(com.mongodb.client.model.mql.MqlString)>`__ + * - `millisecond() <{+core-api+}/client/model/mql/MqlDate.html#millisecond(com.mongodb.client.model.mql.MqlString)>`__ - :manual:`$millisecond ` - * - `minute() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDate.html#minute(com.mongodb.client.model.mql.MqlString)>`__ + * - `minute() <{+core-api+}/client/model/mql/MqlDate.html#minute(com.mongodb.client.model.mql.MqlString)>`__ - :manual:`$minute ` - * - `month() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDate.html#month(com.mongodb.client.model.mql.MqlString)>`__ + * - `month() <{+core-api+}/client/model/mql/MqlDate.html#month(com.mongodb.client.model.mql.MqlString)>`__ - :manual:`$month ` - * - `second() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDate.html#second(com.mongodb.client.model.mql.MqlString)>`__ + * - `second() <{+core-api+}/client/model/mql/MqlDate.html#second(com.mongodb.client.model.mql.MqlString)>`__ - :manual:`$second ` - * - `week() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDate.html#week(com.mongodb.client.model.mql.MqlString)>`__ + * - `week() <{+core-api+}/client/model/mql/MqlDate.html#week(com.mongodb.client.model.mql.MqlString)>`__ - :manual:`$week ` - * - `year() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDate.html#year(com.mongodb.client.model.mql.MqlString)>`__ + * - `year() <{+core-api+}/client/model/mql/MqlDate.html#year(com.mongodb.client.model.mql.MqlString)>`__ - :manual:`$year ` Suppose you have data about package deliveries and need to match @@ -828,27 +828,27 @@ using the methods described in this section. * - Method - Aggregation Pipeline Operator - * - | `getArray() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#getArray(java.lang.String)>`__ - | `getBoolean() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#getBoolean(java.lang.String)>`__ - | `getDate() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#getDate(java.lang.String)>`__ - | `getDocument() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#getDocument(java.lang.String)>`__ - | `getField() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#getField(java.lang.String)>`__ - | `getInteger() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#getInteger(java.lang.String)>`__ - | `getMap() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#getMap(java.lang.String)>`__ - | `getNumber() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#getNumber(java.lang.String)>`__ - | `getString() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#getString(java.lang.String)>`__ + * - | `getArray() <{+core-api+}/client/model/mql/MqlDocument.html#getArray(java.lang.String)>`__ + | `getBoolean() <{+core-api+}/client/model/mql/MqlDocument.html#getBoolean(java.lang.String)>`__ + | `getDate() <{+core-api+}/client/model/mql/MqlDocument.html#getDate(java.lang.String)>`__ + | `getDocument() <{+core-api+}/client/model/mql/MqlDocument.html#getDocument(java.lang.String)>`__ + | `getField() <{+core-api+}/client/model/mql/MqlDocument.html#getField(java.lang.String)>`__ + | `getInteger() <{+core-api+}/client/model/mql/MqlDocument.html#getInteger(java.lang.String)>`__ + | `getMap() <{+core-api+}/client/model/mql/MqlDocument.html#getMap(java.lang.String)>`__ + | `getNumber() <{+core-api+}/client/model/mql/MqlDocument.html#getNumber(java.lang.String)>`__ + | `getString() <{+core-api+}/client/model/mql/MqlDocument.html#getString(java.lang.String)>`__ - :manual:`$getField ` - * - `hasField() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#hasField(java.lang.String)>`__ + * - `hasField() <{+core-api+}/client/model/mql/MqlDocument.html#hasField(java.lang.String)>`__ - *No corresponding operator* - * - `merge() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#merge(com.mongodb.client.model.mql.MqlDocument)>`__ + * - `merge() <{+core-api+}/client/model/mql/MqlDocument.html#merge(com.mongodb.client.model.mql.MqlDocument)>`__ - :manual:`$mergeObjects ` - * - `setField() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#setField(java.lang.String,com.mongodb.client.model.mql.MqlValue)>`__ + * - `setField() <{+core-api+}/client/model/mql/MqlDocument.html#setField(java.lang.String,com.mongodb.client.model.mql.MqlValue)>`__ - :manual:`$setField ` - * - `unsetField() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlDocument.html#unsetField(java.lang.String)>`__ + * - `unsetField() <{+core-api+}/client/model/mql/MqlDocument.html#unsetField(java.lang.String)>`__ - :manual:`$unsetField ` Suppose you have a collection of legacy customer data which includes @@ -915,34 +915,34 @@ You can perform a map operation on a value of either type ``MqlMap`` or * - Method - Aggregation Pipeline Operator - * - `entries() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlMap.html#entries()>`__ + * - `entries() <{+core-api+}/client/model/mql/MqlMap.html#entries()>`__ - :manual:`$objectToArray ` - * - `get() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlMap.html#get(com.mongodb.client.model.mql.MqlString)>`__ + * - `get() <{+core-api+}/client/model/mql/MqlMap.html#get(com.mongodb.client.model.mql.MqlString)>`__ - *No corresponding operator* - * - `getKey() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlEntry.html#getKey()>`__ + * - `getKey() <{+core-api+}/client/model/mql/MqlEntry.html#getKey()>`__ - *No corresponding operator* - * - `getValue() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlEntry.html#getValue()>`__ + * - `getValue() <{+core-api+}/client/model/mql/MqlEntry.html#getValue()>`__ - *No corresponding operator* - * - `has() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlMap.html#has(com.mongodb.client.model.mql.MqlString)>`__ + * - `has() <{+core-api+}/client/model/mql/MqlMap.html#has(com.mongodb.client.model.mql.MqlString)>`__ - *No corresponding operator* - * - `merge() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlMap.html#merge(com.mongodb.client.model.mql.MqlMap)>`__ + * - `merge() <{+core-api+}/client/model/mql/MqlMap.html#merge(com.mongodb.client.model.mql.MqlMap)>`__ - *No corresponding operator* - * - `set() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlMap.html#set(com.mongodb.client.model.mql.MqlString,T)>`__ + * - `set() <{+core-api+}/client/model/mql/MqlMap.html#set(com.mongodb.client.model.mql.MqlString,T)>`__ - *No corresponding operator* - * - `setKey() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlEntry.html#setKey(com.mongodb.client.model.mql.MqlString)>`__ + * - `setKey() <{+core-api+}/client/model/mql/MqlEntry.html#setKey(com.mongodb.client.model.mql.MqlString)>`__ - *No corresponding operator* - * - `setValue() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlEntry.html#setValue(T)>`__ + * - `setValue() <{+core-api+}/client/model/mql/MqlEntry.html#setValue(T)>`__ - *No corresponding operator* - * - `unset() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlMap.html#unset(com.mongodb.client.model.mql.MqlString)>`__ + * - `unset() <{+core-api+}/client/model/mql/MqlMap.html#unset(com.mongodb.client.model.mql.MqlString)>`__ - *No corresponding operator* Suppose you have a collection of inventory data where each document represents @@ -1003,25 +1003,25 @@ using the methods described in this section. * - Method - Aggregation Pipeline Operator - * - `append() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlString.html#append(com.mongodb.client.model.mql.MqlString)>`__ + * - `append() <{+core-api+}/client/model/mql/MqlString.html#append(com.mongodb.client.model.mql.MqlString)>`__ - :manual:`$concat ` - * - `length() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlString.html#length()>`__ + * - `length() <{+core-api+}/client/model/mql/MqlString.html#length()>`__ - :manual:`$strLenCP ` - * - `lengthBytes() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlString.html#lengthBytes()>`__ + * - `lengthBytes() <{+core-api+}/client/model/mql/MqlString.html#lengthBytes()>`__ - :manual:`$strLenBytes ` - * - `substr() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlString.html#substr(int,int)>`__ + * - `substr() <{+core-api+}/client/model/mql/MqlString.html#substr(int,int)>`__ - :manual:`$substrCP ` - * - `substrBytes() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlString.html#substrBytes(int,int)>`__ + * - `substrBytes() <{+core-api+}/client/model/mql/MqlString.html#substrBytes(int,int)>`__ - :manual:`$substrBytes ` - * - `toLower() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlString.html#toLower()>`__ + * - `toLower() <{+core-api+}/client/model/mql/MqlString.html#toLower()>`__ - :manual:`$toLower ` - * - `toUpper() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlString.html#toUpper()>`__ + * - `toUpper() <{+core-api+}/client/model/mql/MqlString.html#toUpper()>`__ - :manual:`$toUpper ` Suppose you need to generate lowercase usernames for employees of a @@ -1067,28 +1067,28 @@ data type, see ``switchOn()``. * - Method - Aggregation Pipeline Operator - * - `isArrayOr() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#isArrayOr(com.mongodb.client.model.mql.MqlArray)>`__ + * - `isArrayOr() <{+core-api+}/client/model/mql/MqlValue.html#isArrayOr(com.mongodb.client.model.mql.MqlArray)>`__ - *No corresponding operator* - * - `isBooleanOr() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#isBooleanOr(com.mongodb.client.model.mql.MqlBoolean)>`__ + * - `isBooleanOr() <{+core-api+}/client/model/mql/MqlValue.html#isBooleanOr(com.mongodb.client.model.mql.MqlBoolean)>`__ - *No corresponding operator* - * - `isDateOr() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#isDateOr(com.mongodb.client.model.mql.MqlDate)>`__ + * - `isDateOr() <{+core-api+}/client/model/mql/MqlValue.html#isDateOr(com.mongodb.client.model.mql.MqlDate)>`__ - *No corresponding operator* - * - `isDocumentOr() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#isDocumentOr(T)>`__ + * - `isDocumentOr() <{+core-api+}/client/model/mql/MqlValue.html#isDocumentOr(T)>`__ - *No corresponding operator* - * - `isIntegerOr() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#isIntegerOr(com.mongodb.client.model.mql.MqlInteger)>`__ + * - `isIntegerOr() <{+core-api+}/client/model/mql/MqlValue.html#isIntegerOr(com.mongodb.client.model.mql.MqlInteger)>`__ - *No corresponding operator* - * - `isMapOr() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#isMapOr(com.mongodb.client.model.mql.MqlMap)>`__ + * - `isMapOr() <{+core-api+}/client/model/mql/MqlValue.html#isMapOr(com.mongodb.client.model.mql.MqlMap)>`__ - *No corresponding operator* - * - `isNumberOr() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#isNumberOr(com.mongodb.client.model.mql.MqlNumber)>`__ + * - `isNumberOr() <{+core-api+}/client/model/mql/MqlValue.html#isNumberOr(com.mongodb.client.model.mql.MqlNumber)>`__ - *No corresponding operator* - * - `isStringOr() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/mql/MqlValue.html#isStringOr(com.mongodb.client.model.mql.MqlString)>`__ + * - `isStringOr() <{+core-api+}/client/model/mql/MqlValue.html#isStringOr(com.mongodb.client.model.mql.MqlString)>`__ - *No corresponding operator* Suppose you have a collection of rating data. An early version of the review diff --git a/source/fundamentals/aggregation.txt b/source/fundamentals/aggregation.txt index 86d728fb..c3d5b45f 100644 --- a/source/fundamentals/aggregation.txt +++ b/source/fundamentals/aggregation.txt @@ -50,7 +50,7 @@ Aggregation operations have some :manual:`limitations `__ + `allowDiskUse <{+driver-api+}/-aggregate-flow/allow-disk-use.html>`__ method. .. important:: ``$graphLookup`` exception @@ -98,7 +98,7 @@ To perform an aggregation, pass a list of aggregation stages to the ``MongoCollection.aggregate()`` method. The Kotlin driver provides the -`Aggregates <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html>`__ +`Aggregates <{+core-api+}/client/model/Aggregates.html>`__ helper class that contains builders for aggregation stages. In the following example, the aggregation pipeline: @@ -127,8 +127,8 @@ In the following example, the aggregation pipeline: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `MongoCollection.aggregate() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/aggregate.html>`__ -- `Aggregates.match <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#match(org.bson.conversions.Bson)>`__ +- `MongoCollection.aggregate() <{+driver-api+}/-mongo-collection/aggregate.html>`__ +- `Aggregates.match <{+core-api+}/client/model/Aggregates.html#match(org.bson.conversions.Bson)>`__ Explain Aggregation ------------------- @@ -169,9 +169,9 @@ following resources: - :manual:`Explain Output ` Server Manual Entry - :manual:`Query Plans ` Server Manual Entry -- `ExplainVerbosity <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ExplainVerbosity>`__ API Documentation -- `explain() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-aggregate-flow/explain.html>`__ API Documentation -- `AggregateFlow <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-aggregate-flow/index.html>`__ API Documentation +- `ExplainVerbosity <{+core-api+}/ExplainVerbosity>`__ API Documentation +- `explain() <{+driver-api+}/-aggregate-flow/explain.html>`__ API Documentation +- `AggregateFlow <{+driver-api+}/-aggregate-flow/index.html>`__ API Documentation Aggregation Expressions ~~~~~~~~~~~~~~~~~~~~~~~ @@ -218,7 +218,7 @@ first element in the ``categories`` field. For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `Accumulators <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html>`__ -- `$group <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#group(TExpression,java.util.List)>`__ -- `$project <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#project(org.bson.conversions.Bson)>`__ -- `Projections <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Projections.html>`__ +- `Accumulators <{+core-api+}/client/model/Accumulators.html>`__ +- `$group <{+core-api+}/client/model/Aggregates.html#group(TExpression,java.util.List)>`__ +- `$project <{+core-api+}/client/model/Aggregates.html#project(org.bson.conversions.Bson)>`__ +- `Projections <{+core-api+}/client/model/Projections.html>`__ diff --git a/source/fundamentals/auth.txt b/source/fundamentals/auth.txt index 02c41cd9..237805ef 100644 --- a/source/fundamentals/auth.txt +++ b/source/fundamentals/auth.txt @@ -150,7 +150,7 @@ mechanism: To specify the default authentication mechanism using the ``MongoCredential`` class, use the - `createScramSha256Credential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createScramSha256Credential(java.lang.String,java.lang.String,char[])>`__ + `createScramSha256Credential() <{+core-api+}/MongoCredential.html#createScramSha256Credential(java.lang.String,java.lang.String,char[])>`__ method. Your code to instantiate a ``MongoClient`` should resemble the following: .. literalinclude:: /examples/generated/AuthTest.snippet.scram-sha-256-cred.kt @@ -202,7 +202,7 @@ mechanism: To specify the default authentication mechanism using the ``MongoCredential`` class, use the - `createScramSha1Credential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createScramSha1Credential(java.lang.String,java.lang.String,char[])>`__ + `createScramSha1Credential() <{+core-api+}/MongoCredential.html#createScramSha1Credential(java.lang.String,java.lang.String,char[])>`__ method. Your code to instantiate a ``MongoClient`` should resemble the following: .. literalinclude:: /examples/generated/AuthTest.snippet.scram-sha-1-cred.kt @@ -400,7 +400,7 @@ Specify Your Credentials in a MongoCredential You can supply your AWS IAM credentials to a ``MongoClient`` by using a ``MongoCredential`` instance. To construct the ``MongoCredential`` instance -for ``MONGODB-AWS`` authentication, use the `createAwsCredential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createAwsCredential(java.lang.String,char%5B%5D)>`__ +for ``MONGODB-AWS`` authentication, use the `createAwsCredential() <{+core-api+}/MongoCredential.html#createAwsCredential(java.lang.String,char%5B%5D)>`__ factory method. You can supply only programmatic access keys to the @@ -424,7 +424,7 @@ in the following example: :emphasize-lines: 1, 9 If you need to specify an AWS session token, pass it to the -`withMechanismProperty() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#withMechanismProperty(java.lang.String,T)>`__ +`withMechanismProperty() <{+core-api+}/MongoCredential.html#withMechanismProperty(java.lang.String,T)>`__ method as shown in the following example: .. literalinclude:: /examples/generated/AuthTest.snippet.aws-credential-session-token.kt @@ -439,7 +439,7 @@ that returns new credentials as shown in the following example: :emphasize-lines: 4-6, 9 If you must provide AWS IAM credentials in a connection string, you can add -it to your ``MongoClientSettings`` by calling the `applyConnectionString() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyConnectionString(com.mongodb.ConnectionString)>`__ +it to your ``MongoClientSettings`` by calling the `applyConnectionString() <{+core-api+}/MongoClientSettings.Builder.html#applyConnectionString(com.mongodb.ConnectionString)>`__ method: .. literalinclude:: /examples/generated/AuthTest.snippet.aws-connection-string-session-token.kt @@ -490,11 +490,11 @@ mechanism: To specify the ``X.509`` authentication mechanism using the ``MongoCredential`` class, use the - `createMongoX509Credential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createMongoX509Credential(java.lang.String)>`__ + `createMongoX509Credential() <{+core-api+}/MongoCredential.html#createMongoX509Credential(java.lang.String)>`__ method. Also, enable TLS by calling the - `applyToSslSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToSslSettings(com.mongodb.Block)>`__ + `applyToSslSettings() <{+core-api+}/MongoClientSettings.Builder.html#applyToSslSettings(com.mongodb.Block)>`__ method and setting the ``enabled`` property to ``true`` in the - `SslSettings.Builder <{+api+}/apidocs/mongodb-driver-core/com/mongodb/connection/SslSettings.Builder.html>`__ + `SslSettings.Builder <{+core-api+}/connection/SslSettings.Builder.html>`__ block. Your code to instantiate a ``MongoClient`` should resemble the following: .. literalinclude:: /examples/generated/AuthTest.snippet.x-509-cred.kt diff --git a/source/fundamentals/builders/aggregates.txt b/source/fundamentals/builders/aggregates.txt index c8532a32..ca5d8913 100644 --- a/source/fundamentals/builders/aggregates.txt +++ b/source/fundamentals/builders/aggregates.txt @@ -24,7 +24,7 @@ Aggregates Builders Overview -------- -In this guide, you can learn how to use the `Aggregates <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates>`__ +In this guide, you can learn how to use the `Aggregates <{+core-api+}/client/model/Aggregates>`__ class which provides static factory methods that build :manual:`aggregation pipeline stages ` in the MongoDB Kotlin driver. @@ -237,7 +237,7 @@ for each distinct grouping. .. tip:: - The driver includes the `Accumulators <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html>`__ + The driver includes the `Accumulators <{+core-api+}/client/model/Accumulators.html>`__ class with static factory methods for each of the supported accumulators. The following example creates a pipeline stage that groups documents @@ -304,7 +304,7 @@ the lowest three ``imdb.rating`` values for movies, grouped by ``year``: .. literalinclude:: /examples/generated/AggregatesBuilderTest.snippet.minN.kt :language: kotlin -See the `minN() API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html#minN(java.lang.String,InExpression,NExpression)>`__ +See the `minN() API documentation <{+core-api+}/client/model/Accumulators.html#minN(java.lang.String,InExpression,NExpression)>`__ for more information. .. _kotlin_aggregates_max_n: @@ -321,7 +321,7 @@ return the highest two ``imdb.rating`` values for movies, grouped by ``year``: .. literalinclude:: /examples/generated/AggregatesBuilderTest.snippet.maxN.kt :language: kotlin -See the `maxN() API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html#maxN(java.lang.String,InExpression,NExpression)>`__ +See the `maxN() API documentation <{+core-api+}/client/model/Accumulators.html#maxN(java.lang.String,InExpression,NExpression)>`__ for more information. .. _kotlin_aggregates_first_n: @@ -346,7 +346,7 @@ into the stage, grouped by ``year``: .. literalinclude:: /examples/generated/AggregatesBuilderTest.snippet.firstN.kt :language: kotlin -See the `firstN() API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html#firstN(java.lang.String,InExpression,NExpression)>`__ +See the `firstN() API documentation <{+core-api+}/client/model/Accumulators.html#firstN(java.lang.String,InExpression,NExpression)>`__ for more information. .. _kotlin_aggregates_last_n: @@ -364,7 +364,7 @@ the stage, grouped by ``year``: .. literalinclude:: /examples/generated/AggregatesBuilderTest.snippet.lastN.kt :language: kotlin -See the `lastN() API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html#lastN(java.lang.String,InExpression,NExpression)>`__ +See the `lastN() API documentation <{+core-api+}/client/model/Accumulators.html#lastN(java.lang.String,InExpression,NExpression)>`__ for more information. .. _kotlin_aggregates_top: @@ -382,7 +382,7 @@ the ``title`` and ``imdb.rating`` values for the top rated movies based on the .. literalinclude:: /examples/generated/AggregatesBuilderTest.snippet.top.kt :language: kotlin -See the `top() API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html#top(java.lang.String,org.bson.conversions.Bson,OutExpression)>`__ +See the `top() API documentation <{+core-api+}/client/model/Accumulators.html#top(java.lang.String,org.bson.conversions.Bson,OutExpression)>`__ for more information. .. _kotlin_aggregates_top_n: @@ -407,7 +407,7 @@ the ``title`` and ``runtime`` values of the three longest movies based on the .. literalinclude:: /examples/generated/AggregatesBuilderTest.snippet.topN.kt :language: kotlin -See the `topN() API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html#topN(java.lang.String,org.bson.conversions.Bson,OutExpression,NExpression)>`__ +See the `topN() API documentation <{+core-api+}/client/model/Accumulators.html#topN(java.lang.String,org.bson.conversions.Bson,OutExpression,NExpression)>`__ for more information. .. _kotlin_aggregates_bottom: @@ -425,7 +425,7 @@ return the ``title`` and ``runtime`` values of the shortest movie based on the .. literalinclude:: /examples/generated/AggregatesBuilderTest.snippet.bottom.kt :language: kotlin -See the `bottom() API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html#bottom(java.lang.String,org.bson.conversions.Bson,OutExpression)>`__ +See the `bottom() API documentation <{+core-api+}/client/model/Accumulators.html#bottom(java.lang.String,org.bson.conversions.Bson,OutExpression)>`__ for more information. .. _kotlin_aggregates_bottom_n: @@ -449,7 +449,7 @@ based on the ``imdb.rating`` value, grouped by ``year``: .. literalinclude:: /examples/generated/AggregatesBuilderTest.snippet.bottomN.kt :language: kotlin -See the `bottomN() API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html#bottomN(java.lang.String,org.bson.conversions.Bson,OutExpression,NExpression)>`__ +See the `bottomN() API documentation <{+core-api+}/client/model/Accumulators.html#bottomN(java.lang.String,org.bson.conversions.Bson,OutExpression,NExpression)>`__ for more information. Unwind @@ -663,7 +663,7 @@ into a bucket called "monster" for monstrously large screen sizes: .. tip:: - The driver includes the `Accumulators <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html>`__ + The driver includes the `Accumulators <{+core-api+}/client/model/Accumulators.html>`__ class with static factory methods for each of the supported accumulators. .. literalinclude:: /examples/generated/AggregatesBuilderTest.snippet.bucket-options.kt @@ -698,7 +698,7 @@ in a new field called ``avgPrice``: .. tip:: - The driver includes the `Accumulators <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html>`__ + The driver includes the `Accumulators <{+core-api+}/client/model/Accumulators.html>`__ class with static factory methods for each of the supported accumulators. .. literalinclude:: /examples/generated/AggregatesBuilderTest.snippet.bucket-auto-options.kt @@ -737,7 +737,7 @@ on a specified span of documents in a collection. .. tip:: Window Functions - The driver includes the `Windows <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Windows.html>`__ + The driver includes the `Windows <{+core-api+}/client/model/Windows.html>`__ class with static factory methods for building windowed computations. The following example uses a fictional ``weather`` collection using data modeled @@ -808,7 +808,7 @@ which contain ``ts`` values every 15 minutes between the existing documents: Document{{ position=Document{{coordinates=[-47.9, 47.6]}}, ts=Mon Mar 05 08:45:00 EST 1984 }} Document{{ _id=5553b..., position=Document{{type=Point, coordinates=[-47.9, 47.6]}}, ts=Mon Mar 05 09:00:00 EST 1984, ... }} -See the `densify package API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/densify/package-summary.html>`__ +See the `densify package API documentation <{+core-api+}/client/model/densify/package-summary.html>`__ for more information. Fill @@ -861,7 +861,7 @@ these actions resembles the following: Weather(id=6308b..., hour=2, temperature=23.5C, air_pressure=29.75) Weather(id=6308b..., hour=3, temperature=23.6C, air_pressure=29.76) -See the `fill package API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/fill/package-summary.html>`__ +See the `fill package API documentation <{+core-api+}/client/model/fill/package-summary.html>`__ for more information. Atlas Full-Text Search @@ -885,7 +885,7 @@ field in the ``movies`` collection for text that contains the word "Future": :language: kotlin Learn more about the builders from the -`search package API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/search/package-summary.html>`__. +`search package API documentation <{+core-api+}/client/model/search/package-summary.html>`__. Atlas Search Metadata --------------------- @@ -909,4 +909,4 @@ aggregation stage: :language: kotlin Learn more about this helper from the -`searchMeta() API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#searchMeta(com.mongodb.client.model.search.SearchCollector)>`__. +`searchMeta() API documentation <{+core-api+}/client/model/Aggregates.html#searchMeta(com.mongodb.client.model.search.SearchCollector)>`__. diff --git a/source/fundamentals/builders/builders-data-classes.txt b/source/fundamentals/builders/builders-data-classes.txt index 592b9a6c..7439c186 100644 --- a/source/fundamentals/builders/builders-data-classes.txt +++ b/source/fundamentals/builders/builders-data-classes.txt @@ -246,4 +246,4 @@ API Documentation ----------------- - `{+driver-short+} Extensions - <{+api+}/apidocs/mongodb-driver-kotlin-extensions/index.html>`__ + <{+api-root+}/mongodb-driver-kotlin-extensions/index.html>`__ diff --git a/source/fundamentals/builders/filters.txt b/source/fundamentals/builders/filters.txt index a879fd4b..82873446 100644 --- a/source/fundamentals/builders/filters.txt +++ b/source/fundamentals/builders/filters.txt @@ -55,7 +55,7 @@ type, which you can pass to any method that expects a query filter. .. tip:: For brevity, you may choose to import all methods of the - `Filters <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html>`__ + `Filters <{+core-api+}/client/model/Filters.html>`__ class statically: .. code-block:: kotlin @@ -101,31 +101,31 @@ The ``Filters`` comparison operator methods include: * - Comparison Method - Matches - * - `eq() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#eq(java.lang.String,TItem)>`__ + * - `eq() <{+core-api+}/client/model/Filters.html#eq(java.lang.String,TItem)>`__ - values equal to a specified value. - * - `gt() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#gt(java.lang.String,TItem)>`__ + * - `gt() <{+core-api+}/client/model/Filters.html#gt(java.lang.String,TItem)>`__ - values greater than a specified value. - * - `gte() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#gte(java.lang.String,TItem)>`__ + * - `gte() <{+core-api+}/client/model/Filters.html#gte(java.lang.String,TItem)>`__ - values greater than or equal to a specified value. - * - `lt() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#lt(java.lang.String,TItem)>`__ + * - `lt() <{+core-api+}/client/model/Filters.html#lt(java.lang.String,TItem)>`__ - values less than a specified value. - * - `lte() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#lte(java.lang.String,TItem)>`__ + * - `lte() <{+core-api+}/client/model/Filters.html#lte(java.lang.String,TItem)>`__ - values less than or equal to a specified value. - * - `ne() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#ne(java.lang.String,TItem)>`__ + * - `ne() <{+core-api+}/client/model/Filters.html#ne(java.lang.String,TItem)>`__ - values not equal to a specified value. - * - `in() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#in(java.lang.String,java.lang.Iterable)>`__ + * - `in() <{+core-api+}/client/model/Filters.html#in(java.lang.String,java.lang.Iterable)>`__ - any of the values specified in an array. - * - `nin() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#nin(java.lang.String,java.lang.Iterable)>`__ + * - `nin() <{+core-api+}/client/model/Filters.html#nin(java.lang.String,java.lang.Iterable)>`__ - none of the values specified in an array. - * - `empty() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#empty()>`__ + * - `empty() <{+core-api+}/client/model/Filters.html#empty()>`__ - all the documents. The following example creates a filter that matches all documents where @@ -192,16 +192,16 @@ The ``Filters`` logical operator methods include: * - Logical Method - Matches - * - `and() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#and(java.lang.Iterable)>`__ + * - `and() <{+core-api+}/client/model/Filters.html#and(java.lang.Iterable)>`__ - documents with the conditions of all the filters. This operator joins filters with a logical ``AND``. - * - `or() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#or(org.bson.conversions.Bson...)>`__ + * - `or() <{+core-api+}/client/model/Filters.html#or(org.bson.conversions.Bson...)>`__ - documents with the conditions of either filter. This operator joins filters with a logical ``OR``. - * - `not() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#not(org.bson.conversions.Bson)>`__ + * - `not() <{+core-api+}/client/model/Filters.html#not(org.bson.conversions.Bson)>`__ - documents that do not match the filter. - * - `nor() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#nor(org.bson.conversions.Bson...)>`__ + * - `nor() <{+core-api+}/client/model/Filters.html#nor(org.bson.conversions.Bson...)>`__ - documents that fail to match both filters. This operator joins filters with a logical ``NOR``. The following example creates a filter that matches documents where @@ -236,13 +236,13 @@ The ``Filters`` array operator methods include: * - Array Method - Matches - * - `all() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#all(java.lang.String,java.lang.Iterable)>`__ + * - `all() <{+core-api+}/client/model/Filters.html#all(java.lang.String,java.lang.Iterable)>`__ - documents if the array field contains every element specified in the query. - * - `elemMatch() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#elemMatch(java.lang.String,org.bson.conversions.Bson)>`__ + * - `elemMatch() <{+core-api+}/client/model/Filters.html#elemMatch(java.lang.String,org.bson.conversions.Bson)>`__ - documents if an element in the array field matches all the specified conditions. - * - `size() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#size(java.lang.String,int)>`__ + * - `size() <{+core-api+}/client/model/Filters.html#size(java.lang.String,int)>`__ - documents if the array field is a specified number of elements. The following example matches documents with a ``vendors`` array @@ -275,10 +275,10 @@ The ``Filters`` elements operator methods include: * - Elements Method - Matches - * - `exists() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#exists(java.lang.String)>`__ + * - `exists() <{+core-api+}/client/model/Filters.html#exists(java.lang.String)>`__ - documents that have the specified field. - * - `type() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#type(java.lang.String,java.lang.String)>`__ + * - `type() <{+core-api+}/client/model/Filters.html#type(java.lang.String,java.lang.String)>`__ - documents if a field is of the specified type. The following example matches documents that have a ``qty`` field and @@ -313,16 +313,16 @@ The ``Filters`` evaluation operator methods include: * - Evaluation Method - Matches - * - `mod() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#mod(java.lang.String,long,long)>`__ + * - `mod() <{+core-api+}/client/model/Filters.html#mod(java.lang.String,long,long)>`__ - documents where a modulo operation on the value of a field contain a specified result. - * - `regex() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#regex(java.lang.String,java.lang.String)>`__ + * - `regex() <{+core-api+}/client/model/Filters.html#regex(java.lang.String,java.lang.String)>`__ - documents where values contain a specified regular expression. - * - `text() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#text(java.lang.String)>`__ + * - `text() <{+core-api+}/client/model/Filters.html#text(java.lang.String)>`__ - documents which contain a specified full-text search expression. - * - `where() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#where(java.lang.String)>`__ + * - `where() <{+core-api+}/client/model/Filters.html#where(java.lang.String)>`__ - documents which contain a specified JavaScript expression. The following example matches documents that have a ``color`` field @@ -356,16 +356,16 @@ The ``Filters`` bitwise operator methods include: * - Bitwise Method - Matches - * - `bitsAllSet() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#bitsAllSet(java.lang.String,long)>`__ + * - `bitsAllSet() <{+core-api+}/client/model/Filters.html#bitsAllSet(java.lang.String,long)>`__ - documents where the specified bits of a field are set (i.e. "1"). - * - `bitsAllClear() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#bitsAllClear(java.lang.String,long)>`__ + * - `bitsAllClear() <{+core-api+}/client/model/Filters.html#bitsAllClear(java.lang.String,long)>`__ - documents where the specified bits of a field are clear (i.e. "0"). - * - `bitsAnySet() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#bitsAnySet(java.lang.String,long)>`__ + * - `bitsAnySet() <{+core-api+}/client/model/Filters.html#bitsAnySet(java.lang.String,long)>`__ - documents where at least one of the specified bits of a field are set (i.e. "1"). - * - `bitsAnyClear() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#bitsAnyClear(java.lang.String,long)>`__ + * - `bitsAnyClear() <{+core-api+}/client/model/Filters.html#bitsAnyClear(java.lang.String,long)>`__ - documents where at least one of the specified bits of a field are clear (i.e. "0"). The following example matches documents that have a ``decimalValue`` field @@ -408,28 +408,28 @@ The ``Filters`` geospatial operator methods include: * - Geospatial Method - Matches - * - `geoWithin() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#geoWithin(java.lang.String,org.bson.conversions.Bson)>`__ + * - `geoWithin() <{+core-api+}/client/model/Filters.html#geoWithin(java.lang.String,org.bson.conversions.Bson)>`__ - documents containing a GeoJSON geometry value that falls within a bounding GeoJSON geometry. - * - `geoWithinBox() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#geoWithinBox(java.lang.String,double,double,double,double)>`__ + * - `geoWithinBox() <{+core-api+}/client/model/Filters.html#geoWithinBox(java.lang.String,double,double,double,double)>`__ - documents containing a coordinates value that exist within the specified box. - * - `geoWithinPolygon() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#geoWithinPolygon(java.lang.String,java.util.List)>`__ + * - `geoWithinPolygon() <{+core-api+}/client/model/Filters.html#geoWithinPolygon(java.lang.String,java.util.List)>`__ - documents containing a coordinates value that exist within the specified polygon. - * - `geoWithinCenter() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#geoWithinCenter(java.lang.String,double,double,double)>`__ + * - `geoWithinCenter() <{+core-api+}/client/model/Filters.html#geoWithinCenter(java.lang.String,double,double,double)>`__ - documents containing a coordinates value that exist within the specified circle. - * - `geoWithinCenterSphere() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#geoWithinCenterSphere(java.lang.String,double,double,double)>`__ + * - `geoWithinCenterSphere() <{+core-api+}/client/model/Filters.html#geoWithinCenterSphere(java.lang.String,double,double,double)>`__ - geometries containing a geospatial data value (GeoJSON or legacy coordinate pairs) that exist within the specified circle, using spherical geometry. - * - `geoIntersects() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#geoIntersects(java.lang.String,org.bson.conversions.Bson)>`__ + * - `geoIntersects() <{+core-api+}/client/model/Filters.html#geoIntersects(java.lang.String,org.bson.conversions.Bson)>`__ - geometries that intersect with a GeoJSON geometry. The ``2dsphere`` index supports ``$geoIntersects``. - * - `near() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#near(java.lang.String,org.bson.conversions.Bson,java.lang.Double,java.lang.Double)>`__ + * - `near() <{+core-api+}/client/model/Filters.html#near(java.lang.String,org.bson.conversions.Bson,java.lang.Double,java.lang.Double)>`__ - geospatial objects in proximity to a point. Requires a geospatial index. The ``2dsphere`` and ``2d`` indexes support ``$near``. - * - `nearSphere() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#nearSphere(java.lang.String,org.bson.conversions.Bson,java.lang.Double,java.lang.Double)>`__ + * - `nearSphere() <{+core-api+}/client/model/Filters.html#nearSphere(java.lang.String,org.bson.conversions.Bson,java.lang.Double,java.lang.Double)>`__ - geospatial objects in proximity to a point on a sphere. Requires a geospatial index. The ``2dsphere`` and ``2d`` indexes support ``$nearSphere``. The following example creates a filter that matches documents in which diff --git a/source/fundamentals/builders/indexes.txt b/source/fundamentals/builders/indexes.txt index a3e05f82..6aa19cc0 100644 --- a/source/fundamentals/builders/indexes.txt +++ b/source/fundamentals/builders/indexes.txt @@ -31,14 +31,14 @@ the field. See our guide on :doc:`Indexes ` for examples of queries covered by indexes. The ``Indexes`` class provides static factory methods for all the MongoDB index types. -Each method returns a `BSON <{+api+}/apidocs/bson/org/bson/conversions/Bson.html>`__ +Each method returns a `BSON <{+api-root+}/bson/org/bson/conversions/Bson.html>`__ instance, which you can pass to -`createIndex() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/create-index.html>`__. +`createIndex() <{+driver-api+}/-mongo-collection/create-index.html>`__. .. tip:: For brevity, you may choose to import all methods of the - `Indexes <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Indexes.html>`__ + `Indexes <{+core-api+}/client/model/Indexes.html>`__ class: .. code-block:: kotlin @@ -56,7 +56,7 @@ An ascending index enables you to sort query results by the value of the indexed fields from smallest to largest. In order to create an ascending index, first call the -`ascending() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Indexes.html#ascending(java.lang.String...)>`__ +`ascending() <{+core-api+}/client/model/Indexes.html#ascending(java.lang.String...)>`__ builder method to create a ``Bson`` instance that represents the index document, passing the name or names of the fields you want to index. Then, call the ``createIndex()`` method on the collection, passing the ``Bson`` @@ -88,7 +88,7 @@ A descending index enables you to sort query results by the value of the indexed fields from largest to smallest. In order to create a descending index, first call the -`descending() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Indexes.html#descending(java.lang.String...)>`__ +`descending() <{+core-api+}/client/model/Indexes.html#descending(java.lang.String...)>`__ builder method to create a ``Bson`` instance that represents the index document, passing the name or names of the fields you want to index. Then, call the ``createIndex()`` method on the collection, passing the ``Bson`` @@ -112,7 +112,7 @@ Compound Indexes ---------------- In order to create a compound index, first call the -`compoundIndex() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Indexes.html#compoundIndex(org.bson.conversions.Bson...)>`__ +`compoundIndex() <{+core-api+}/client/model/Indexes.html#compoundIndex(org.bson.conversions.Bson...)>`__ builder method to create a ``Bson`` instance that represents the index document, passing the names of the fields you want to index. Then, call the ``createIndex()`` method on the collection, passing the ``Bson`` @@ -140,7 +140,7 @@ Text Indexes A text index groups documents by the text in the indexed field. In order to create a text index, first call the -`text() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Indexes.html#text(java.lang.String)>`__ +`text() <{+core-api+}/client/model/Indexes.html#text(java.lang.String)>`__ builder method to create a ``Bson`` instance that represents the index document, passing the name of the fields you want to index. Then, call the ``createIndex()`` method on the collection, passing the ``Bson`` @@ -166,7 +166,7 @@ Hashed Indexes A hashed index groups documents by the hash value in the indexed field. In order to create a hashed index, first call the -`hashed() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Indexes.html#hashed(java.lang.String)>`__ +`hashed() <{+core-api+}/client/model/Indexes.html#hashed(java.lang.String)>`__ builder method to create a ``Bson`` instance that represents the index document, passing the name of the fields you want to index. Then, call the ``createIndex()`` method on the collection, passing the ``Bson`` @@ -194,7 +194,7 @@ Geospatial Indexes A ``2dsphere`` index groups documents by the coordinates in the indexed field. In order to create a ``2dsphere`` index, first call the -`geo2dsphere() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Indexes.html#geo2dsphere(java.lang.String...)>`__ +`geo2dsphere() <{+core-api+}/client/model/Indexes.html#geo2dsphere(java.lang.String...)>`__ builder method to create a ``Bson`` instance that represents the index document, passing the name or names of the fields you want to index. Then, call the ``createIndex()`` method on the collection, passing the ``Bson`` diff --git a/source/fundamentals/builders/projections.txt b/source/fundamentals/builders/projections.txt index 82316de6..7c376749 100644 --- a/source/fundamentals/builders/projections.txt +++ b/source/fundamentals/builders/projections.txt @@ -32,7 +32,7 @@ to any method that expects a projection. .. tip:: For brevity, you may choose to import the methods of the - `Projections <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Projections.html>`__ + `Projections <{+core-api+}/client/model/Projections.html>`__ class: diff --git a/source/fundamentals/builders/sort.txt b/source/fundamentals/builders/sort.txt index 6d9a41ec..8fb056f8 100644 --- a/source/fundamentals/builders/sort.txt +++ b/source/fundamentals/builders/sort.txt @@ -69,10 +69,10 @@ class, see the :ref:`Aggregates builder ` guide. For more information about the classes and interfaces in this section, see the following API Documentation: -- `Sorts <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Sorts.html>`__ -- `BSON <{+api+}/apidocs/bson/org/bson/conversions/Bson.html>`__ -- `FindFlow <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/index.html>`__ -- `Aggregates <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html>`__ +- `Sorts <{+core-api+}/client/model/Sorts.html>`__ +- `BSON <{+api-root+}/bson/org/bson/conversions/Bson.html>`__ +- `FindFlow <{+driver-api+}/-find-flow/index.html>`__ +- `Aggregates <{+core-api+}/client/model/Aggregates.html>`__ Ascending --------- @@ -166,5 +166,5 @@ the ``Sorts.metaTextScore()`` method, see :ref:`the text search section ` of the sorting guide. For more information, see the `Sorts class -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Sorts.html>`__ +<{+core-api+}/client/model/Sorts.html>`__ API Documentation. diff --git a/source/fundamentals/builders/updates.txt b/source/fundamentals/builders/updates.txt index 8ebcf85d..3702a1e4 100644 --- a/source/fundamentals/builders/updates.txt +++ b/source/fundamentals/builders/updates.txt @@ -42,7 +42,7 @@ type, which you can pass to any method that expects an update argument. .. tip:: - For brevity, you may choose to import the methods of the `Updates <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html>`__ class: + For brevity, you may choose to import the methods of the `Updates <{+core-api+}/client/model/Updates.html>`__ class: .. code-block:: kotlin @@ -79,7 +79,7 @@ Field Updates Set ~~~ -Use the `set() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#set(java.lang.String,TItem)>`__ +Use the `set() <{+core-api+}/client/model/Updates.html#set(java.lang.String,TItem)>`__ method to assign the value of a field in an update operation. The following example sets the value of the ``qty`` field to ``11``: @@ -107,7 +107,7 @@ The preceding example updates the original document to the following state: Unset ~~~~~ -Use the `unset() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#unset(java.lang.String)>`__ method +Use the `unset() <{+core-api+}/client/model/Updates.html#unset(java.lang.String)>`__ method to delete the value of a field in an update operation. The following example deletes the ``qty`` field: @@ -134,7 +134,7 @@ The preceding example updates the original document to the following state: Set On Insert ~~~~~~~~~~~~~ -Use the `setOnInsert() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#setOnInsert(java.lang.String,TItem)>`__ +Use the `setOnInsert() <{+core-api+}/client/model/Updates.html#setOnInsert(java.lang.String,TItem)>`__ method to assign the value of a field in an update operation on an insert of a document. @@ -161,7 +161,7 @@ The preceding example updates the original document to the following state: Increment ~~~~~~~~~ -Use the `inc() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#inc(java.lang.String,java.lang.Number)>`__ +Use the `inc() <{+core-api+}/client/model/Updates.html#inc(java.lang.String,java.lang.Number)>`__ method to increment the value of a numeric field in an update operation. The following example increments the value of the ``qty`` field, which was ``5``, by ``3``: @@ -189,7 +189,7 @@ The preceding example updates the original document to the following state: Multiply ~~~~~~~~ -Use the `mul() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#mul(java.lang.String,java.lang.Number)>`__ +Use the `mul() <{+core-api+}/client/model/Updates.html#mul(java.lang.String,java.lang.Number)>`__ method to multiply the value of a numeric field in an update operation. The following example multiplies the value of the ``qty`` field, which @@ -218,7 +218,7 @@ The preceding example updates the original document to the following state: Rename ~~~~~~ -Use the `rename() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#rename(java.lang.String,java.lang.String)>`__ +Use the `rename() <{+core-api+}/client/model/Updates.html#rename(java.lang.String,java.lang.String)>`__ method to rename the value of a field in an update operation. The following example renames the ``qty`` field to ``quantity``: @@ -246,7 +246,7 @@ The preceding example updates the original document to the following state: Min ~~~ -Use the `min() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#min(java.lang.String,TItem)>`__ +Use the `min() <{+core-api+}/client/model/Updates.html#min(java.lang.String,TItem)>`__ method to set the value of the field to the given value if the given value is less than the current value of the field. @@ -276,7 +276,7 @@ The preceding example updates the original document to the following state: Max ~~~ -Use the `max() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#max(java.lang.String,TItem)>`__ +Use the `max() <{+core-api+}/client/model/Updates.html#max(java.lang.String,TItem)>`__ method to update the value of a field with the larger number of the two specified in an update operation. @@ -306,7 +306,7 @@ The preceding example updates the original document to the following state: Current Date ~~~~~~~~~~~~ -Use the `currentDate() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#currentDate(java.lang.String)>`__ +Use the `currentDate() <{+core-api+}/client/model/Updates.html#currentDate(java.lang.String)>`__ method to assign the value of a field in an update operation to the current date as a :manual:`BSON date `. @@ -337,7 +337,7 @@ the original document to the following state: Current Timestamp ~~~~~~~~~~~~~~~~~ -Use the `currentTimestamp() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#currentTimestamp(java.lang.String)>`__ +Use the `currentTimestamp() <{+core-api+}/client/model/Updates.html#currentTimestamp(java.lang.String)>`__ method to assign the value of a field in an update operation to the current date as a :manual:`timestamp `. @@ -368,9 +368,9 @@ the original document to the following state: Bit ~~~ -Use the `bitwiseOr() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#bitwiseOr(java.lang.String,int)>`__, -`bitwiseAnd() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#bitwiseAnd(java.lang.String,int)>`__, -and `bitwiseXor() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#bitwiseXor(java.lang.String,int)>`__ +Use the `bitwiseOr() <{+core-api+}/client/model/Updates.html#bitwiseOr(java.lang.String,int)>`__, +`bitwiseAnd() <{+core-api+}/client/model/Updates.html#bitwiseAnd(java.lang.String,int)>`__, +and `bitwiseXor() <{+core-api+}/client/model/Updates.html#bitwiseXor(java.lang.String,int)>`__ methods to perform a bitwise update of the integer value of a field in an update operation. @@ -415,7 +415,7 @@ Array Updates Add to Set ~~~~~~~~~~ -Use the `addToSet() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#addToSet(java.lang.String,TItem)>`__ +Use the `addToSet() <{+core-api+}/client/model/Updates.html#addToSet(java.lang.String,TItem)>`__ method to append a value to an array if the value is not already present in an update operation. @@ -446,9 +446,9 @@ The preceding example updates the original document to the following state: Pop ~~~ -Use the `popFirst() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#popFirst(java.lang.String)>`__ +Use the `popFirst() <{+core-api+}/client/model/Updates.html#popFirst(java.lang.String)>`__ method to remove the first element of an array and the -`popLast() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#popLast(java.lang.String)>`__ +`popLast() <{+core-api+}/client/model/Updates.html#popLast(java.lang.String)>`__ method to remove the last element of an array in an update operation. The following example removes the first entry of the ``vendor`` array: @@ -475,7 +475,7 @@ The preceding example updates the original document to the following state: Pull All ~~~~~~~~ -Use the `pullAll() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#pullAll(java.lang.String,java.util.List)>`__ +Use the `pullAll() <{+core-api+}/client/model/Updates.html#pullAll(java.lang.String,java.util.List)>`__ method to remove all instances of specified values from an existing array in an update operation. @@ -503,7 +503,7 @@ The preceding example updates the original document to the following state: Pull ~~~~ -Use the `pull() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#pull(java.lang.String,TItem)>`__ +Use the `pull() <{+core-api+}/client/model/Updates.html#pull(java.lang.String,TItem)>`__ method to remove all instances of a specified value from an existing array in an update operation. @@ -532,7 +532,7 @@ The preceding example updates the original document to the following state: Push ~~~~ -Use the `push() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#push(java.lang.String,TItem)>`__ +Use the `push() <{+core-api+}/client/model/Updates.html#push(java.lang.String,TItem)>`__ method to append a value to an array in an update operation. The following example adds a ``Vendor`` instance that has a ``name`` diff --git a/source/fundamentals/builders/vector-search.txt b/source/fundamentals/builders/vector-search.txt index f5ff4c7e..12f85436 100644 --- a/source/fundamentals/builders/vector-search.txt +++ b/source/fundamentals/builders/vector-search.txt @@ -91,12 +91,12 @@ To learn more about the methods and types mentioned in this guide, see the following API documentation: - `Aggregates.vectorSearch() - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#vectorSearch(com.mongodb.client.model.search.FieldSearchPath,java.lang.Iterable,java.lang.String,long,com.mongodb.client.model.search.VectorSearchOptions)>`__ + <{+core-api+}/client/model/Aggregates.html#vectorSearch(com.mongodb.client.model.search.FieldSearchPath,java.lang.Iterable,java.lang.String,long,com.mongodb.client.model.search.VectorSearchOptions)>`__ - `FieldSearchPath - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/search/FieldSearchPath.html>`__ + <{+core-api+}/client/model/search/FieldSearchPath.html>`__ - `VectorSearchOptions - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/search/VectorSearchOptions.html>`__ + <{+core-api+}/client/model/search/VectorSearchOptions.html>`__ -- `BinaryVector <{+api+}/apidocs/bson/org/bson/BinaryVector.html>`__ +- `BinaryVector <{+api-root+}/bson/org/bson/BinaryVector.html>`__ diff --git a/source/fundamentals/collations.txt b/source/fundamentals/collations.txt index d20e3b59..8d3428b0 100644 --- a/source/fundamentals/collations.txt +++ b/source/fundamentals/collations.txt @@ -266,39 +266,39 @@ further refine the ordering and matching behavior. * - Locale - | **Required**. The ICU locale code for language and variant. - | `locale() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Collation.Builder.html#locale(java.lang.String)>`__ API Documentation + | `locale() <{+core-api+}/client/model/Collation.Builder.html#locale(java.lang.String)>`__ API Documentation * - Backwards - | Whether to consider diacritics from the end of the string first. - | `backwards() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Collation.Builder.html#backwards(java.lang.Boolean)>`__ API Documentation + | `backwards() <{+core-api+}/client/model/Collation.Builder.html#backwards(java.lang.Boolean)>`__ API Documentation * - Case-sensitivity - | Whether to consider case (upper or lower) as different values. - | `caseLevel() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Collation.Builder.html#caseLevel(java.lang.Boolean)>`__ API Documentation + | `caseLevel() <{+core-api+}/client/model/Collation.Builder.html#caseLevel(java.lang.Boolean)>`__ API Documentation * - Alternate - | Whether to consider spaces and punctuation. - | `collationAlternate() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Collation.Builder.html#collationAlternate(com.mongodb.client.model.CollationAlternate)>`__ API Documentation + | `collationAlternate() <{+core-api+}/client/model/Collation.Builder.html#collationAlternate(com.mongodb.client.model.CollationAlternate)>`__ API Documentation * - Case First - | Whether to consider uppercase or lowercase first. - | `collationCaseFirst() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Collation.Builder.html#collationCaseFirst(com.mongodb.client.model.CollationCaseFirst)>`__ API Documentation + | `collationCaseFirst() <{+core-api+}/client/model/Collation.Builder.html#collationCaseFirst(com.mongodb.client.model.CollationCaseFirst)>`__ API Documentation * - Max Variable - | Whether to ignore whitespace or both whitespace and punctuation. This setting is only valid when the alternate setting is "shifted". - | `collationMaxVariable() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Collation.Builder.html#collationMaxVariable(com.mongodb.client.model.CollationMaxVariable)>`__ API Documentation + | `collationMaxVariable() <{+core-api+}/client/model/Collation.Builder.html#collationMaxVariable(com.mongodb.client.model.CollationMaxVariable)>`__ API Documentation * - Strength - | ICU level of comparison. The default value is "tertiary". For more information on each level, see the `ICU Comparison Levels `__. - | `collationStrength() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Collation.Builder.html#collationStrength(com.mongodb.client.model.CollationStrength)>`__ API Documentation + | `collationStrength() <{+core-api+}/client/model/Collation.Builder.html#collationStrength(com.mongodb.client.model.CollationStrength)>`__ API Documentation * - Normalization - | Whether to perform unicode normalization on the text as needed. For more information on unicode normalization, see `Unicode Normalization Forms `__. - | `normalization() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Collation.Builder.html#normalization(java.lang.Boolean)>`__ API Documentation + | `normalization() <{+core-api+}/client/model/Collation.Builder.html#normalization(java.lang.Boolean)>`__ API Documentation * - Numeric Ordering - | Whether to order numbers according to numeric value rather than collation order. - | `numericOrdering() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Collation.Builder.html#numericOrdering(java.lang.Boolean)>`__ API Documentation + | `numericOrdering() <{+core-api+}/client/model/Collation.Builder.html#numericOrdering(java.lang.Boolean)>`__ API Documentation You can use the ``Collation.Builder`` class to specify values for the preceding collation options. You can call the ``build()`` method to construct a @@ -309,7 +309,7 @@ preceding collation options. You can call the ``build()`` method to construct a For more information on the corresponding methods and parameters they take, see the API Documentation for `Collation.Builder -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Collation.Builder.html>`__. +<{+core-api+}/client/model/Collation.Builder.html>`__. .. _collations-examples: @@ -356,9 +356,9 @@ the output should resemble the following: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `find() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find.html>`__ -- `sort() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/sort.html>`__ -- `Sorts <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Sorts.html>`__ +- `find() <{+driver-api+}/-mongo-collection/find.html>`__ +- `sort() <{+driver-api+}/-find-flow/sort.html>`__ +- `Sorts <{+core-api+}/client/model/Sorts.html>`__ findOneAndUpdate() Example ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -400,11 +400,11 @@ returns "Günter" before "Gunter" in the results: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `findOneAndUpdate <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find-one-and-update.html>`__ -- `findOneAndUpdateOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/FindOneAndUpdateOptions.html>`__ -- `Filters <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html>`__ -- `Updates <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html>`__ -- `Sorts <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Sorts.html>`__ +- `findOneAndUpdate <{+driver-api+}/-mongo-collection/find-one-and-update.html>`__ +- `findOneAndUpdateOptions <{+core-api+}/client/model/FindOneAndUpdateOptions.html>`__ +- `Filters <{+core-api+}/client/model/Filters.html>`__ +- `Updates <{+core-api+}/client/model/Updates.html>`__ +- `Sorts <{+core-api+}/client/model/Sorts.html>`__ findOneAndDelete() Example @@ -461,10 +461,10 @@ by binary collation. For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `findOneAndDelete <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find-one-and-delete.html>`__ -- `FindOneAndDeleteOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/FindOneAndDeleteOptions.html>`__ -- `Filters <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html>`__ -- `Sorts <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Sorts.html>`__ +- `findOneAndDelete <{+driver-api+}/-mongo-collection/find-one-and-delete.html>`__ +- `FindOneAndDeleteOptions <{+core-api+}/client/model/FindOneAndDeleteOptions.html>`__ +- `Filters <{+core-api+}/client/model/Filters.html>`__ +- `Sorts <{+core-api+}/client/model/Sorts.html>`__ Aggregation Example ~~~~~~~~~~~~~~~~~~~ @@ -510,10 +510,10 @@ a collation by specifying the following: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `aggregate() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/aggregate.html>`__ -- `AggregateFlow <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-aggregate-flow/index.html>`__ -- `CollationStrength <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/CollationStrength.html>`__ -- `Accumulators <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Accumulators.html>`__ -- `Aggregates <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html>`__ -- `Sorts <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Sorts.html>`__ +- `aggregate() <{+driver-api+}/-mongo-collection/aggregate.html>`__ +- `AggregateFlow <{+driver-api+}/-aggregate-flow/index.html>`__ +- `CollationStrength <{+core-api+}/client/model/CollationStrength.html>`__ +- `Accumulators <{+core-api+}/client/model/Accumulators.html>`__ +- `Aggregates <{+core-api+}/client/model/Aggregates.html>`__ +- `Sorts <{+core-api+}/client/model/Sorts.html>`__ diff --git a/source/fundamentals/connection/connection-options.txt b/source/fundamentals/connection/connection-options.txt index 5a115417..bc539c6e 100644 --- a/source/fundamentals/connection/connection-options.txt +++ b/source/fundamentals/connection/connection-options.txt @@ -275,7 +275,7 @@ parameters of the connection URI to specify the behavior of the client. - Specifies the UUID representation to use for read and write operations. For more information, see the driver documentation for the - `MongoClientSettings.getUuidRepresentation() method <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html#getUuidRepresentation()>`__. + `MongoClientSettings.getUuidRepresentation() method <{+core-api+}/MongoClientSettings.html#getUuidRepresentation()>`__. | **Default**: ``unspecified`` @@ -307,5 +307,5 @@ parameters of the connection URI to specify the behavior of the client. | **Default**: ``mongodb`` For a complete list of options, see the -`ConnectionString <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ConnectionString.html>`__ +`ConnectionString <{+core-api+}/ConnectionString.html>`__ API reference page. diff --git a/source/fundamentals/connection/mongoclientsettings.txt b/source/fundamentals/connection/mongoclientsettings.txt index 6fca6693..515b67d8 100644 --- a/source/fundamentals/connection/mongoclientsettings.txt +++ b/source/fundamentals/connection/mongoclientsettings.txt @@ -33,8 +33,8 @@ MongoClient Settings -------------------- You can control the behavior of your ``MongoClient`` by creating and passing -in a `MongoClientSettings <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html>`__ -object to the `MongoClient.create() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-client/-factory/create.html>`__ +in a `MongoClientSettings <{+core-api+}/MongoClientSettings.html>`__ +object to the `MongoClient.create() <{+driver-api+}/-mongo-client/-factory/create.html>`__ method. To create a ``MongoClientSettings`` object, use the @@ -180,7 +180,7 @@ This example demonstrates specifying a ``ConnectionString``: Cluster Settings ---------------- -Chain the `applyToClusterSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToClusterSettings(com.mongodb.Block)>`__ +Chain the `applyToClusterSettings() <{+core-api+}/MongoClientSettings.Builder.html#applyToClusterSettings(com.mongodb.Block)>`__ method to modify the driver's behavior when interacting with your MongoDB cluster. @@ -269,7 +269,7 @@ regardless of the type of MongoDB cluster it's a part of: Socket Settings --------------- -Chain the `applyToSocketSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToSocketSettings(com.mongodb.Block)>`__ +Chain the `applyToSocketSettings() <{+core-api+}/MongoClientSettings.Builder.html#applyToSocketSettings(com.mongodb.Block)>`__ method to modify the driver's behavior when connecting and communicating with your MongoDB server. @@ -324,7 +324,7 @@ This example specifies the following driver behavior in a MongoDB socket: Connection Pool Settings ------------------------ -Chain the `applyToConnectionPoolSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToConnectionPoolSettings(com.mongodb.Block)>`__ +Chain the `applyToConnectionPoolSettings() <{+core-api+}/MongoClientSettings.Builder.html#applyToConnectionPoolSettings(com.mongodb.Block)>`__ method to modify the way the driver manages its connection pool. The following table describes all the methods you can chain to your @@ -399,7 +399,7 @@ This example specifies the following driver behavior in a pool of Server Settings --------------- -Chain the `applyToServerSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToServerSettings(com.mongodb.Block)>`__ +Chain the `applyToServerSettings() <{+core-api+}/MongoClientSettings.Builder.html#applyToServerSettings(com.mongodb.Block)>`__ method to modify the driver's behavior when monitoring each MongoDB server. @@ -453,7 +453,7 @@ This example specifies the following driver behavior in a MongoDB server: TLS/SSL Settings ---------------- -Chain the `applyToSslSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToSslSettings(com.mongodb.Block)>`__ +Chain the `applyToSslSettings() <{+core-api+}/MongoClientSettings.Builder.html#applyToSslSettings(com.mongodb.Block)>`__ method to modify the driver's behavior when using TLS/SSL to secure a connection between your application and MongoDB. diff --git a/source/fundamentals/connection/network-compression.txt b/source/fundamentals/connection/network-compression.txt index d9485f41..c7e2544f 100644 --- a/source/fundamentals/connection/network-compression.txt +++ b/source/fundamentals/connection/network-compression.txt @@ -52,7 +52,7 @@ algorithms in the following ways: :tabid: specify compressors in connection string To enable compression on your connection in a `ConnectionString - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ConnectionString.html>`__ + <{+core-api+}/ConnectionString.html>`__ instance, specify the ``compressors`` parameter. You can specify one or more of the following values for the ``compressors`` parameter: @@ -70,9 +70,9 @@ algorithms in the following ways: .. tab:: MongoClientSettings :tabid: specify compressors in MongoClientSettings - To enable compression using within your `MongoClientSettings <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html>`__, - call the `compressorList() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#compressorList(java.util.List)>`__ - builder method and pass one or more `MongoCompressor <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCompressor.html>`__ + To enable compression using within your `MongoClientSettings <{+core-api+}/MongoClientSettings.html>`__, + call the `compressorList() <{+core-api+}/MongoClientSettings.Builder.html#compressorList(java.util.List)>`__ + builder method and pass one or more `MongoCompressor <{+core-api+}/MongoCompressor.html>`__ instances as a parameter. You can specify compression algorithms by calling the following diff --git a/source/fundamentals/connection/socks5.txt b/source/fundamentals/connection/socks5.txt index e2049ad4..a3813d86 100644 --- a/source/fundamentals/connection/socks5.txt +++ b/source/fundamentals/connection/socks5.txt @@ -108,7 +108,7 @@ API Documentation To learn more about the methods and types discussed in this guide, see the following API documentation: -- `MongoClientSettings.Builder <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html>`__ -- `SocketSettings.Builder <{+api+}/apidocs/mongodb-driver-core/com/mongodb/connection/SocketSettings.Builder.html>`__ -- `MongoClient.create() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClients.html#create(com.mongodb.MongoClientSettings)>`__ -- `ProxySettings.Builder <{+api+}/apidocs/mongodb-driver-core/com/mongodb/connection/ProxySettings.Builder.html>`__ \ No newline at end of file +- `MongoClientSettings.Builder <{+core-api+}/MongoClientSettings.Builder.html>`__ +- `SocketSettings.Builder <{+core-api+}/connection/SocketSettings.Builder.html>`__ +- `MongoClient.create() <{+api-root+}/mongodb-driver-sync/com/mongodb/client/MongoClients.html#create(com.mongodb.MongoClientSettings)>`__ +- `ProxySettings.Builder <{+core-api+}/connection/ProxySettings.Builder.html>`__ \ No newline at end of file diff --git a/source/fundamentals/connection/tls.txt b/source/fundamentals/connection/tls.txt index ab294bc1..7821feb9 100644 --- a/source/fundamentals/connection/tls.txt +++ b/source/fundamentals/connection/tls.txt @@ -24,8 +24,8 @@ In this guide, you can learn how to connect to MongoDB instances with the `TLS/SSL `__ security protocol using the underlying TLS/SSL support in the JDK. To configure your connection to use TLS/SSL, enable the TLS/SSL settings in -either the `ConnectionString <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ConnectionString.html>`__ -or `MongoClientSettings <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html>`__. +either the `ConnectionString <{+core-api+}/ConnectionString.html>`__ +or `MongoClientSettings <{+core-api+}/MongoClientSettings.html>`__. .. note:: Debugging TLS/SSL @@ -63,7 +63,7 @@ using a method in the ``MongoClientSettings.Builder`` class. :tabid: connectionstring To enable TLS/SSL on a connection with a `ConnectionString - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ConnectionString.html>`__, assign the connection string + <{+core-api+}/ConnectionString.html>`__, assign the connection string parameter ``tls`` a value of ``true`` in the connection string passed to ``MongoClient.create()``: @@ -75,7 +75,7 @@ using a method in the ``MongoClientSettings.Builder`` class. To configure your ``MongoClient``'s TLS/SSL connection options using the ``MongoClientSettings.Builder`` class, call the - `applyToSslSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToSslSettings(com.mongodb.Block)>`__ + `applyToSslSettings() <{+core-api+}/MongoClientSettings.Builder.html#applyToSslSettings(com.mongodb.Block)>`__ method. Set the ``enabled`` property to ``true`` in the ``SslSettings.Builder`` block to enable TLS/SSL: diff --git a/source/fundamentals/crud/compound-operations.txt b/source/fundamentals/crud/compound-operations.txt index df6fe51e..de0af0ec 100644 --- a/source/fundamentals/crud/compound-operations.txt +++ b/source/fundamentals/crud/compound-operations.txt @@ -106,9 +106,9 @@ For more information on the upsert operation, see our For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `findOneAndUpdate() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find-one-and-update.html>`__ -- `FindOneAndUpdateOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/FindOneAndUpdateOptions.html>`__ -- `MongoExecutionTimeoutException <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoExecutionTimeoutException.html>`__ +- `findOneAndUpdate() <{+driver-api+}/-mongo-collection/find-one-and-update.html>`__ +- `FindOneAndUpdateOptions <{+core-api+}/client/model/FindOneAndUpdateOptions.html>`__ +- `MongoExecutionTimeoutException <{+core-api+}/MongoExecutionTimeoutException.html>`__ .. _kotlin-find-and-replace-example: @@ -147,8 +147,8 @@ the returned document should be in the state after our replace operation. For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `findOneAndReplace() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find-one-and-replace.html>`__ -- `FindOneAndReplaceOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/FindOneAndReplaceOptions.html>`__ +- `findOneAndReplace() <{+driver-api+}/-mongo-collection/find-one-and-replace.html>`__ +- `FindOneAndReplaceOptions <{+core-api+}/client/model/FindOneAndReplaceOptions.html>`__ Find and Delete ~~~~~~~~~~~~~~~ @@ -182,8 +182,8 @@ For more information on the ``Sorts`` class, see our For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `findOneAndDelete() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find-one-and-delete.html>`__ -- `FindOneAndDeleteOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/FindOneAndDeleteOptions.html>`__ +- `findOneAndDelete() <{+driver-api+}/-mongo-collection/find-one-and-delete.html>`__ +- `FindOneAndDeleteOptions <{+core-api+}/client/model/FindOneAndDeleteOptions.html>`__ Avoiding a Race Condition ------------------------- @@ -311,4 +311,4 @@ For more information of the ``Filters`` class, see our :doc:`guide on the Filters builder `. For more information on the ``findOneAndUpdate()`` method, see -the API Documentation for the `MongoCollection class <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/index.html>`__. +the API Documentation for the `MongoCollection class <{+driver-api+}/-mongo-collection/index.html>`__. diff --git a/source/fundamentals/crud/read-operations/change-streams.txt b/source/fundamentals/crud/read-operations/change-streams.txt index 080a9675..ddaee19b 100644 --- a/source/fundamentals/crud/read-operations/change-streams.txt +++ b/source/fundamentals/crud/read-operations/change-streams.txt @@ -93,9 +93,9 @@ For a runnable example, see the :ref:`` usage example page. To learn more about the ``watch()`` method, see the following API documentation: -- `MongoCollection.watch() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/watch.html>`__ -- `MongoDatabase.watch() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-database/watch.html>`__ -- `MongoClient.watch() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-cluster/watch.html>`__ +- `MongoCollection.watch() <{+driver-api+}/-mongo-collection/watch.html>`__ +- `MongoDatabase.watch() <{+driver-api+}/-mongo-database/watch.html>`__ +- `MongoClient.watch() <{+driver-api+}/-mongo-cluster/watch.html>`__ .. _kotlin-change-stream-aggregation: @@ -274,7 +274,7 @@ should resemble the following text: fullDocumentBeforeChange=Document{{_id=6388..., latestVersion=2.0.0, ...}}, ... -For a list of options, see the `FullDocumentBeforeChange <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/changestream/FullDocumentBeforeChange.html>`__ +For a list of options, see the `FullDocumentBeforeChange <{+core-api+}/client/model/changestream/FullDocumentBeforeChange.html>`__ API documentation. .. _kotlin-post-image-example: @@ -311,5 +311,5 @@ resemble the following text: updatedFields={"population": 950}, ... ... -For a list of options, see the `FullDocument <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/changestream/FullDocument.html>`__ +For a list of options, see the `FullDocument <{+core-api+}/client/model/changestream/FullDocument.html>`__ API documentation. diff --git a/source/fundamentals/crud/read-operations/flow.txt b/source/fundamentals/crud/read-operations/flow.txt index 98950f77..10c83762 100644 --- a/source/fundamentals/crud/read-operations/flow.txt +++ b/source/fundamentals/crud/read-operations/flow.txt @@ -22,13 +22,13 @@ uses flows to represent the results of database read operations. This page uses an initiating method, ``find()`` to show how to access data from a `FindFlow -<{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/index.html>`__. +<{+driver-api+}/-find-flow/index.html>`__. .. note:: The following ways to access and store data apply to other iterables such as an `AggregateFlow - <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-aggregate-flow/index.html>`__. + <{+driver-api+}/-aggregate-flow/index.html>`__. The ``find()`` method creates and returns an instance of a ``FindFlow``. A ``FindFlow`` allows you to browse the documents @@ -123,6 +123,6 @@ Server Manual Entries: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `collect() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/collect.html>`__ -- `explain() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/explain.html>`__ -- `ExplainVerbosity <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ExplainVerbosity>`__ +- `collect() <{+driver-api+}/-find-flow/collect.html>`__ +- `explain() <{+driver-api+}/-find-flow/explain.html>`__ +- `ExplainVerbosity <{+core-api+}/ExplainVerbosity>`__ diff --git a/source/fundamentals/crud/read-operations/geo.txt b/source/fundamentals/crud/read-operations/geo.txt index 53a8fc8b..842e66b1 100644 --- a/source/fundamentals/crud/read-operations/geo.txt +++ b/source/fundamentals/crud/read-operations/geo.txt @@ -178,7 +178,7 @@ To specify a shape to use in a geospatial query, use the ``Position``, ``Point``, ``LineString``, and ``Polygon`` classes from the {+driver-short+}. To learn more about the GeoJSON shape classes, see the -`GeoJSON package <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/geojson/package-summary.html>`__ +`GeoJSON package <{+core-api+}/client/model/geojson/package-summary.html>`__ API Documentation. Geospatial Query Examples diff --git a/source/fundamentals/crud/read-operations/limit.txt b/source/fundamentals/crud/read-operations/limit.txt index 7c6d3b37..62ccba06 100644 --- a/source/fundamentals/crud/read-operations/limit.txt +++ b/source/fundamentals/crud/read-operations/limit.txt @@ -128,5 +128,5 @@ collection, returning only small subsets of the collection at one time. For more information about the methods and classes mentioned in this guide, see the following API Documentation: -- `FindFlow.collect() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/collect.html>`__ -- `MongoCollection.find() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find.html>`__ +- `FindFlow.collect() <{+driver-api+}/-find-flow/collect.html>`__ +- `MongoCollection.find() <{+driver-api+}/-mongo-collection/find.html>`__ diff --git a/source/fundamentals/crud/read-operations/retrieve.txt b/source/fundamentals/crud/read-operations/retrieve.txt index 2419fb89..18b97b0e 100644 --- a/source/fundamentals/crud/read-operations/retrieve.txt +++ b/source/fundamentals/crud/read-operations/retrieve.txt @@ -140,5 +140,5 @@ To learn more about constructing aggregation pipelines, see To learn more about the methods mentioned on this page, see the following API Documentation: -- `MongoCollection.find() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find.html>`__ -- `MongoCollection.aggregate() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/aggregate.html>`__ +- `MongoCollection.find() <{+driver-api+}/-mongo-collection/find.html>`__ +- `MongoCollection.aggregate() <{+driver-api+}/-mongo-collection/aggregate.html>`__ diff --git a/source/fundamentals/crud/read-operations/skip.txt b/source/fundamentals/crud/read-operations/skip.txt index b1049828..58e54f03 100644 --- a/source/fundamentals/crud/read-operations/skip.txt +++ b/source/fundamentals/crud/read-operations/skip.txt @@ -22,14 +22,14 @@ aggregation pipeline by specifying a ``$skip`` aggregation stage. The ``skip()`` method takes an integer that specifies the number of documents to omit from the beginning of the list of documents returned by the -`FindFlow <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/index.html>`__. +`FindFlow <{+driver-api+}/-find-flow/index.html>`__. You can use the ``skip()`` method to skip the first two documents as follows: .. literalinclude:: /examples/generated/SkipTest.snippet.basic-skip.kt :language: kotlin -`Aggregates.skip() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#skip(int)>`__ +`Aggregates.skip() <{+core-api+}/client/model/Aggregates.html#skip(int)>`__ is an optional stage in the aggregation pipeline that specifies how many documents to omit from the beginning of the results of the prior stage. diff --git a/source/fundamentals/crud/read-operations/sort.txt b/source/fundamentals/crud/read-operations/sort.txt index 045d3596..9d31514b 100644 --- a/source/fundamentals/crud/read-operations/sort.txt +++ b/source/fundamentals/crud/read-operations/sort.txt @@ -61,7 +61,7 @@ To sort your query results, use the aggregation pipeline, use the ``Aggregates.sort()`` static factory method. Both of these methods receive objects that implement the ``Bson`` interface as arguments. For more information, see the API Documentation for the -`BSON interface <{+api+}/apidocs/bson/org/bson/conversions/Bson.html>`__. +`BSON interface <{+api-root+}/bson/org/bson/conversions/Bson.html>`__. You can use the ``sort()`` method of a ``FindFlow`` instance as follows: @@ -97,11 +97,11 @@ builder class, see the :ref:`Sorts builder ` guide. For more information about the classes and interfaces in this section, see the following API Documentation: -- `FindFlow <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/index.html>`__ -- `Aggregates <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html>`__ -- `Sorts <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Sorts.html>`__ -- `BSON <{+api+}/apidocs/bson/org/bson/conversions/Bson.html>`__ -- `Document <{+api+}/apidocs/bson/org/bson/Document.html>`__ +- `FindFlow <{+driver-api+}/-find-flow/index.html>`__ +- `Aggregates <{+core-api+}/client/model/Aggregates.html>`__ +- `Sorts <{+core-api+}/client/model/Sorts.html>`__ +- `BSON <{+api-root+}/bson/org/bson/conversions/Bson.html>`__ +- `Document <{+api-root+}/bson/org/bson/Document.html>`__ Sorting Direction ----------------- @@ -332,13 +332,13 @@ The data is modeled with the following Kotlin data class: For more information about the classes in this section, see the following API Documentation: -- `Filters <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html>`__ -- `Indexes <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Indexes.html>`__ -- `Projections <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Projections.html>`__ -- `MongoCollection <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/index.html>`__ +- `Filters <{+core-api+}/client/model/Filters.html>`__ +- `Indexes <{+core-api+}/client/model/Indexes.html>`__ +- `Projections <{+core-api+}/client/model/Projections.html>`__ +- `MongoCollection <{+driver-api+}/-mongo-collection/index.html>`__ For more information, see the -`Sorts class <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Sorts.html>`__ API Documentation. +`Sorts class <{+core-api+}/client/model/Sorts.html>`__ API Documentation. See the server manual documentation for more information on the :manual:`$text ` query operator and the :manual:`$meta ` diff --git a/source/fundamentals/crud/read-operations/text.txt b/source/fundamentals/crud/read-operations/text.txt index 8f2e6e93..4ac0b76e 100644 --- a/source/fundamentals/crud/read-operations/text.txt +++ b/source/fundamentals/crud/read-operations/text.txt @@ -110,8 +110,8 @@ To specify a case sensitive search, use the following snippet: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `Filters.text() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#text(java.lang.String)>`__ -- `TextSearchOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/TextSearchOptions.html>`__ +- `Filters.text() <{+core-api+}/client/model/Filters.html#text(java.lang.String)>`__ +- `TextSearchOptions <{+core-api+}/client/model/TextSearchOptions.html>`__ .. _term_search: diff --git a/source/fundamentals/crud/write-operations/bulk.txt b/source/fundamentals/crud/write-operations/bulk.txt index 1e8a764f..bc1d6c83 100644 --- a/source/fundamentals/crud/write-operations/bulk.txt +++ b/source/fundamentals/crud/write-operations/bulk.txt @@ -83,9 +83,9 @@ This data is modeled by the following {+language+} data class: For more information about the methods and classes mentioned in this section, see the following API documentation: -- `bulkWrite() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/bulk-write.html>`__ -- `WriteModel <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/WriteModel.html>`__ -- `BulkWriteOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/BulkWriteOptions.html>`__ +- `bulkWrite() <{+driver-api+}/-mongo-collection/bulk-write.html>`__ +- `WriteModel <{+core-api+}/client/model/WriteModel.html>`__ +- `BulkWriteOptions <{+core-api+}/client/model/BulkWriteOptions.html>`__ Insert Operation ~~~~~~~~~~~~~~~~ @@ -130,7 +130,7 @@ describing people: ``_id`` of ``3``, see the :ref:`Order of Execution ` section. For more information about the methods and classes mentioned in this section, -see the `InsertOneModel <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/InsertOneModel.html>`__ API documentation. +see the `InsertOneModel <{+core-api+}/client/model/InsertOneModel.html>`__ API documentation. Replace Operation ~~~~~~~~~~~~~~~~~ @@ -168,8 +168,8 @@ operation, as shown in the following code: For more information about the methods and classes mentioned in this section, see the following resources: -- `ReplaceOneModel <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/ReplaceOneModel.html>`__ API documentation -- `ReplaceOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/ReplaceOptions.html>`__ API documentation +- `ReplaceOneModel <{+core-api+}/client/model/ReplaceOneModel.html>`__ API documentation +- `ReplaceOptions <{+core-api+}/client/model/ReplaceOptions.html>`__ API documentation - :manual:`Unique indexes ` reference in the Server Manual Update Operation @@ -211,9 +211,9 @@ operation, as shown in the following code: For more information about the methods and classes mentioned in this section, see the following resources: -- `UpdateOneModel <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/UpdateOneModel.html>`__ API documentation -- `UpdateManyModel <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/UpdateManyModel.html>`__ API documentation -- `UpdateOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/UpdateOptions.html>`__ API documentation +- `UpdateOneModel <{+core-api+}/client/model/UpdateOneModel.html>`__ API documentation +- `UpdateManyModel <{+core-api+}/client/model/UpdateManyModel.html>`__ API documentation +- `UpdateOptions <{+core-api+}/client/model/UpdateOptions.html>`__ API documentation - :manual:`unique indexes ` Server Manual Explanation Delete Operation @@ -246,8 +246,8 @@ documents where the ``age`` value is less than ``30``: For more information about the methods and classes mentioned in this section, see the following API documentation: -- `DeleteOneModel <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/DeleteOneModel.html>`__ -- `DeleteManyModel <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/DeleteManyModel.html>`__ +- `DeleteOneModel <{+core-api+}/client/model/DeleteOneModel.html>`__ +- `DeleteManyModel <{+core-api+}/client/model/DeleteManyModel.html>`__ .. _orderOfExecution: @@ -327,8 +327,8 @@ of execution: For more information about the methods and classes mentioned in this section, see the following API documentation: -- `BulkWriteOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/BulkWriteOptions.html>`__ -- `ordered() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/BulkWriteOptions.html#ordered(boolean)>`__ +- `BulkWriteOptions <{+core-api+}/client/model/BulkWriteOptions.html>`__ +- `ordered() <{+core-api+}/client/model/BulkWriteOptions.html#ordered(boolean)>`__ .. _kotlin-client-bulk-write: @@ -449,10 +449,10 @@ To learn more about the methods and classes mentioned in this section, see the following API documentation: - `bulkWrite() - <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-cluster/bulk-write.html>`__ + <{+driver-api+}/-mongo-cluster/bulk-write.html>`__ - `ClientNamespacedWriteModel - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/bulk/ClientNamespacedWriteModel.html>`__ -- `MongoNamespace <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoNamespace.html>`__ + <{+core-api+}/client/model/bulk/ClientNamespacedWriteModel.html>`__ +- `MongoNamespace <{+core-api+}/MongoNamespace.html>`__ Insert Operation ~~~~~~~~~~~~~~~~ @@ -486,7 +486,7 @@ value of ``"electronic"`` in the ``objects`` collection. If multiple documents match the query filter specified in a ``ClientNamespacedUpdateOneModel`` instance, the operation updates the first result. You can specify a sort order in a `ClientUpdateOneOptions -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/bulk/ClientUpdateOneOptions.html>`__ +<{+core-api+}/client/model/bulk/ClientUpdateOneOptions.html>`__ instance to apply an order to matched documents before the server performs the update operation, as shown in the following code: @@ -515,7 +515,7 @@ is replaced with a new document. If multiple documents match the query filter specified in a ``ClientNamespacedReplaceOneModel`` instance, the operation replaces the first result. You can specify a sort order in a `ClientReplaceOneOptions -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/bulk/ClientReplaceOneOptions.html>`__ +<{+core-api+}/client/model/bulk/ClientReplaceOneOptions.html>`__ instance to apply an order to matched documents before the driver performs the replace operation, as shown in the following code: @@ -559,8 +559,8 @@ unordered. To learn more about the methods and classes mentioned in this section, see the following API documentation: -- `ClientBulkWriteOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/bulk/ClientBulkWriteOptions.html>`__ -- `ClientBulkWriteResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/bulk/ClientBulkWriteResult.html>`__ +- `ClientBulkWriteOptions <{+core-api+}/client/model/bulk/ClientBulkWriteOptions.html>`__ +- `ClientBulkWriteResult <{+core-api+}/client/model/bulk/ClientBulkWriteResult.html>`__ Summary ------- diff --git a/source/fundamentals/crud/write-operations/delete.txt b/source/fundamentals/crud/write-operations/delete.txt index 1d605236..73ac3d56 100644 --- a/source/fundamentals/crud/write-operations/delete.txt +++ b/source/fundamentals/crud/write-operations/delete.txt @@ -152,11 +152,11 @@ collection: For more information about the methods and classes mentioned in this guide, see the following resources: -- `deleteOne() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/delete-one.html>`__ API Documentation -- `deleteMany() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/delete-many.html>`__ API Documentation -- `findOneAndDelete() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find-one-and-delete.html>`__ API Documentation -- `DeleteOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/DeleteOptions.html>`__ API Documentation -- `FindOneAndDeleteOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/FindOneAndDeleteOptions.html>`__ API Documentation +- `deleteOne() <{+driver-api+}/-mongo-collection/delete-one.html>`__ API Documentation +- `deleteMany() <{+driver-api+}/-mongo-collection/delete-many.html>`__ API Documentation +- `findOneAndDelete() <{+driver-api+}/-mongo-collection/find-one-and-delete.html>`__ API Documentation +- `DeleteOptions <{+core-api+}/client/model/DeleteOptions.html>`__ API Documentation +- `FindOneAndDeleteOptions <{+core-api+}/client/model/FindOneAndDeleteOptions.html>`__ API Documentation - :manual:`db.collection.deleteOne() ` Server Manual Entry - :manual:`db.collection.deleteMany() ` Server Manual Entry - :manual:`db.collection.findOneAndDelete() ` Server Manual Entry diff --git a/source/fundamentals/crud/write-operations/embedded-arrays.txt b/source/fundamentals/crud/write-operations/embedded-arrays.txt index d9a076ab..ca5b5821 100644 --- a/source/fundamentals/crud/write-operations/embedded-arrays.txt +++ b/source/fundamentals/crud/write-operations/embedded-arrays.txt @@ -112,7 +112,7 @@ For more information about the methods and operators mentioned in this section, see the following resources: - :manual:`Positional $ Operator ` Server Manual Entry -- `inc() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#inc(java.lang.String,java.lang.Number)>`__ API Documentation +- `inc() <{+core-api+}/client/model/Updates.html#inc(java.lang.String,java.lang.Number)>`__ API Documentation Matching All Array Elements ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -141,7 +141,7 @@ For more information about the methods and operators mentioned in this section, see the following resources: - :manual:`All Positional $[] Operator ` Server Manual Entry -- `mul() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#mul(java.lang.String,java.lang.Number)>`__ API Documentation +- `mul() <{+core-api+}/client/model/Updates.html#mul(java.lang.String,java.lang.Number)>`__ API Documentation Matching Multiple Array Elements ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -178,4 +178,4 @@ For more information about the methods and operators mentioned in this section, see the following resources: - :manual:`Filtered Positional $[\] Operator ` Server Manual Entry -- `inc() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#inc(java.lang.String,java.lang.Number)>`__ API Documentation +- `inc() <{+core-api+}/client/model/Updates.html#inc(java.lang.String,java.lang.Number)>`__ API Documentation diff --git a/source/fundamentals/crud/write-operations/insert.txt b/source/fundamentals/crud/write-operations/insert.txt index a2ffe778..b6e0415f 100644 --- a/source/fundamentals/crud/write-operations/insert.txt +++ b/source/fundamentals/crud/write-operations/insert.txt @@ -89,8 +89,8 @@ The following example creates and inserts a document using the For more information about the methods and classes mentioned in this section, see the following resources: -- `insertOne() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/insert-one.html>`__ API Documentation -- `InsertOneResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/InsertOneResult.html>`__ API Documentation +- `insertOne() <{+driver-api+}/-mongo-collection/insert-one.html>`__ API Documentation +- `InsertOneResult <{+core-api+}/client/result/InsertOneResult.html>`__ API Documentation - Manual Explanation on :manual:`insertOne() ` - Runnable :doc:`Insert a Document example ` @@ -162,8 +162,8 @@ inserts the ``List`` using the ``insertMany()`` method: For more information about the methods and classes mentioned in this section, see the following resources: -- `insertMany() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/insert-many.html>`__ API Documentation -- `InsertManyResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/InsertManyResult.html>`__ API Documentation +- `insertMany() <{+driver-api+}/-mongo-collection/insert-many.html>`__ API Documentation +- `InsertManyResult <{+core-api+}/client/result/InsertManyResult.html>`__ API Documentation - Manual Explanation on :manual:`insertMany() ` - Runnable :doc:`Insert Multiple Documents example ` diff --git a/source/fundamentals/crud/write-operations/modify.txt b/source/fundamentals/crud/write-operations/modify.txt index 4af9cec1..f1edd24e 100644 --- a/source/fundamentals/crud/write-operations/modify.txt +++ b/source/fundamentals/crud/write-operations/modify.txt @@ -57,9 +57,9 @@ Update operations can modify fields and values. They apply changes specified in an update document to one or more documents that match your query filter. -The `updateOne() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/update-one.html>`__ +The `updateOne() <{+driver-api+}/-mongo-collection/update-one.html>`__ method changes the first document your query filter matches and the -`updateMany() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/update-many.html>`__ +`updateMany() <{+driver-api+}/-mongo-collection/update-many.html>`__ method changes all the documents your query filter matches. You can call the ``updateOne()`` and ``updateMany()`` methods on a @@ -84,7 +84,7 @@ parameters: - *(Optional)* ``updateOptions`` specifies options that you can set to customize how the driver performs the update operation. To learn more about this type, see the API documentation for `UpdateOptions - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/UpdateOptions.html>`__. + <{+core-api+}/client/model/UpdateOptions.html>`__. You can create the ``updateDocument`` using an ``Updates`` builder as follows: @@ -94,7 +94,7 @@ follows: val updateDocument = Updates.operator(, ) To view a complete list of ``Updates`` builders and their usage, see `Updates -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html>`__ +<{+core-api+}/client/model/Updates.html>`__ in the API documentation. Update One Example @@ -187,7 +187,7 @@ A replace operation substitutes one document from your collection. The substitution occurs between a document your query filter matches and a replacement document. -The `replaceOne() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/replace-one.html>`__ +The `replaceOne() <{+driver-api+}/-mongo-collection/replace-one.html>`__ method removes all the existing fields and values in the matching document (except the ``_id`` field) and substitutes it with the replacement document. @@ -209,7 +209,7 @@ The ``replaceOne()`` method has the following parameters: - *(Optional)* ``replaceOptions`` specifies options that you can set to customize how the driver performs the replace operation. To learn more about this type, see the API documentation for `ReplaceOptions - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/ReplaceOptions.html>`__. + <{+core-api+}/client/model/ReplaceOptions.html>`__. Replace One Example ~~~~~~~~~~~~~~~~~~~ diff --git a/source/fundamentals/crud/write-operations/upsert.txt b/source/fundamentals/crud/write-operations/upsert.txt index c6287a2c..8508935f 100644 --- a/source/fundamentals/crud/write-operations/upsert.txt +++ b/source/fundamentals/crud/write-operations/upsert.txt @@ -111,5 +111,5 @@ The following shows the documents in the ``paint_inventory`` collection: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `UpdateOptions.upsert() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/UpdateOptions.html#upsert(boolean)>`__ -- `ReplaceOptions.upsert() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/ReplaceOptions.html#upsert(boolean)>`__ +- `UpdateOptions.upsert() <{+core-api+}/client/model/UpdateOptions.html#upsert(boolean)>`__ +- `ReplaceOptions.upsert() <{+core-api+}/client/model/ReplaceOptions.html#upsert(boolean)>`__ diff --git a/source/fundamentals/data-formats/codecs.txt b/source/fundamentals/data-formats/codecs.txt index 84d0d9c0..2915ab61 100644 --- a/source/fundamentals/data-formats/codecs.txt +++ b/source/fundamentals/data-formats/codecs.txt @@ -120,13 +120,13 @@ section of this page to see how you can include your ``Codec``. For more information about the classes and interfaces in this section, see the following API Documentation: -- `Codec <{+api+}/apidocs/bson/org/bson/codecs/Codec.html>`__ -- `BsonWriter <{+api+}/apidocs/bson/org/bson/BsonWriter.html>`__ -- `BsonBinaryWriter <{+api+}/apidocs/bson/org/bson/BsonBinaryWriter.html>`__ -- `EncoderContext <{+api+}/apidocs/bson/org/bson/codecs/EncoderContext.html>`__ -- `BsonReader <{+api+}/apidocs/bson/org/bson/BsonReader.html>`__ -- `DecoderContext <{+api+}/apidocs/bson/org/bson/codecs/DecoderContext.html>`__ -- `BsonBinaryReader <{+api+}/apidocs/bson/org/bson/BsonBinaryReader.html>`__ +- `Codec <{+api-root+}/bson/org/bson/codecs/Codec.html>`__ +- `BsonWriter <{+api-root+}/bson/org/bson/BsonWriter.html>`__ +- `BsonBinaryWriter <{+api-root+}/bson/org/bson/BsonBinaryWriter.html>`__ +- `EncoderContext <{+api-root+}/bson/org/bson/codecs/EncoderContext.html>`__ +- `BsonReader <{+api-root+}/bson/org/bson/BsonReader.html>`__ +- `DecoderContext <{+api-root+}/bson/org/bson/codecs/DecoderContext.html>`__ +- `BsonBinaryReader <{+api-root+}/bson/org/bson/BsonBinaryReader.html>`__ .. _codecs-codecregistry: @@ -169,8 +169,8 @@ exception. For more information about the classes and interfaces in this section, see the following API Documentation: -- `CodecRegistries <{+api+}/apidocs/bson/org/bson/codecs/configuration/CodecRegistries.html>`__ -- `IntegerCodec <{+api+}/apidocs/bson/org/bson/codecs/IntegerCodec.html>`__ +- `CodecRegistries <{+api-root+}/bson/org/bson/codecs/configuration/CodecRegistries.html>`__ +- `IntegerCodec <{+api-root+}/bson/org/bson/codecs/IntegerCodec.html>`__ .. _codecs-codecprovider: @@ -226,8 +226,8 @@ list prior to the default codec registry as shown in the example below: For more information about the classes and interfaces in this section, see the following API documentation sections: -- `CodecProvider <{+api+}/apidocs/bson/org/bson/codecs/configuration/CodecProvider.html>`__ -- `Default codec registry <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html#getDefaultCodecRegistry()>`__ +- `CodecProvider <{+api-root+}/bson/org/bson/codecs/configuration/CodecProvider.html>`__ +- `Default codec registry <{+core-api+}/MongoClientSettings.html#getDefaultCodecRegistry()>`__ BsonTypeClassMap ---------------- @@ -271,7 +271,7 @@ instance with the ``Set`` class: Java type: java.util.Set For a complete list of the default mappings, refer to the -`BsonTypeClassMap <{+api+}/apidocs/bson/org/bson/codecs/BsonTypeClassMap.html>`__ API Documentation. +`BsonTypeClassMap <{+api-root+}/bson/org/bson/codecs/BsonTypeClassMap.html>`__ API Documentation. For an example of how the ``Document`` class uses ``BsonTypeClassMap``, see the driver source code for the following classes: @@ -352,7 +352,7 @@ retrieves data using the ``Monolight`` class and associated codecs: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `withCodecRegistry() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/with-codec-registry.html?query=fun%20withCodecRegistry(newCodecRegistry:%20CodecRegistry)>`__ -- `MongoClientSettings.getDefaultCodecRegistry() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html#getDefaultCodecRegistry()>`__ -- `Codec <{+api+}/apidocs/bson/org/bson/codecs/Codec.html>`__ -- `CodecProvider <{+api+}/apidocs/bson/org/bson/codecs/configuration/CodecProvider.html>`__ +- `withCodecRegistry() <{+driver-api+}/-mongo-collection/with-codec-registry.html?query=fun%20withCodecRegistry(newCodecRegistry:%20CodecRegistry)>`__ +- `MongoClientSettings.getDefaultCodecRegistry() <{+core-api+}/MongoClientSettings.html#getDefaultCodecRegistry()>`__ +- `Codec <{+api-root+}/bson/org/bson/codecs/Codec.html>`__ +- `CodecProvider <{+api-root+}/bson/org/bson/codecs/configuration/CodecProvider.html>`__ diff --git a/source/fundamentals/data-formats/document-data-format-bson.txt b/source/fundamentals/data-formats/document-data-format-bson.txt index f4489d3a..ccaf0a6a 100644 --- a/source/fundamentals/data-formats/document-data-format-bson.txt +++ b/source/fundamentals/data-formats/document-data-format-bson.txt @@ -36,13 +36,13 @@ MongoDB and BSON The MongoDB Kotlin driver, which uses the BSON library, allows you to work with BSON data by using one of the object types that implements the -`BSON interface <{+api+}/apidocs/bson/org/bson/conversions/Bson.html>`__, +`BSON interface <{+api-root+}/bson/org/bson/conversions/Bson.html>`__, including: -- `Document <{+api+}/apidocs/bson/org/bson/Document.html>`__ (BSON library package) -- `BsonDocument <{+api+}/apidocs/bson/org/bson/BsonDocument.html>`__ (BSON library package) -- `RawBsonDocument <{+api+}/apidocs/bson/org/bson/RawBsonDocument.html>`__ (BSON library package) -- `JsonObject <{+api+}/apidocs/bson/org/bson/json/JsonObject.html>`__ (BSON library package) +- `Document <{+api-root+}/bson/org/bson/Document.html>`__ (BSON library package) +- `BsonDocument <{+api-root+}/bson/org/bson/BsonDocument.html>`__ (BSON library package) +- `RawBsonDocument <{+api-root+}/bson/org/bson/RawBsonDocument.html>`__ (BSON library package) +- `JsonObject <{+api-root+}/bson/org/bson/json/JsonObject.html>`__ (BSON library package) For more information on using these object types, see our :doc:`Documents guide `. diff --git a/source/fundamentals/data-formats/document-data-format-data-class.txt b/source/fundamentals/data-formats/document-data-format-data-class.txt index c20d3a77..01cc6ea5 100644 --- a/source/fundamentals/data-formats/document-data-format-data-class.txt +++ b/source/fundamentals/data-formats/document-data-format-data-class.txt @@ -123,7 +123,7 @@ You can use the following annotations on data classes: as the same type as the data class property. For reference information on these property annotations, -refer to the `org.bson.codecs.pojo.annotations <{+api+}/apidocs/bson/org/bson/codecs/pojo/annotations/package-summary.html>`__ +refer to the `org.bson.codecs.pojo.annotations <{+api-root+}/bson/org/bson/codecs/pojo/annotations/package-summary.html>`__ package. Example Annotated Data Class diff --git a/source/fundamentals/data-formats/document-data-format-extended-json.txt b/source/fundamentals/data-formats/document-data-format-extended-json.txt index c828a8fe..71aea9fb 100644 --- a/source/fundamentals/data-formats/document-data-format-extended-json.txt +++ b/source/fundamentals/data-formats/document-data-format-extended-json.txt @@ -84,7 +84,7 @@ resources: - `JSON RFC `__ Official Documentation - :manual:`MongoDB Extended JSON ` Server Manual Entry -- `BsonBinary <{+api+}/apidocs/bson/org/bson/BsonBinary.html>`__ API Documentation +- `BsonBinary <{+api-root+}/bson/org/bson/BsonBinary.html>`__ API Documentation - `Extended JSON specification `__ GitHub Documentation Extended JSON Examples @@ -194,7 +194,7 @@ an Extended JSON string into Kotlin objects: 4794261 is type: java.lang.Long For more information, see the `JsonReader -<{+api+}/apidocs/bson/org/bson/json/JsonReader.html>`__ API Documentation. +<{+api-root+}/bson/org/bson/json/JsonReader.html>`__ API Documentation. Write Extended JSON ------------------- @@ -246,9 +246,9 @@ by passing the ``outputMode()`` builder method the ``JsonMode.EXTENDED`` constan For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `JsonWriter <{+api+}/apidocs/bson/org/bson/json/JsonWriter.html>`__ -- `JsonWriterSettings <{+api+}/apidocs/bson/org/bson/json/JsonWriterSettings.html>`__ -- `outputMode() <{+api+}/apidocs/bson/org/bson/json/JsonWriterSettings.Builder.html#outputMode(org.bson.json.JsonMode)>`__ +- `JsonWriter <{+api-root+}/bson/org/bson/json/JsonWriter.html>`__ +- `JsonWriterSettings <{+api-root+}/bson/org/bson/json/JsonWriterSettings.html>`__ +- `outputMode() <{+api-root+}/bson/org/bson/json/JsonWriterSettings.Builder.html#outputMode(org.bson.json.JsonMode)>`__ Custom BSON Type Conversion --------------------------- @@ -278,5 +278,5 @@ expressions, to simplify the Relaxed mode JSON output. For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `Converter <{+api+}/apidocs/bson/org/bson/json/Converter.html>`__ -- `JsonWriterSettings.Builder <{+api+}/apidocs/bson/org/bson/json/JsonWriterSettings.Builder.html>`__ \ No newline at end of file +- `Converter <{+api-root+}/bson/org/bson/json/Converter.html>`__ +- `JsonWriterSettings.Builder <{+api-root+}/bson/org/bson/json/JsonWriterSettings.Builder.html>`__ \ No newline at end of file diff --git a/source/fundamentals/data-formats/documents.txt b/source/fundamentals/data-formats/documents.txt index 339eb475..0f8635e1 100644 --- a/source/fundamentals/data-formats/documents.txt +++ b/source/fundamentals/data-formats/documents.txt @@ -139,9 +139,9 @@ For more information on retrieving and manipulating MongoDB data, see our For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `Document <{+api+}/apidocs/bson/org/bson/Document.html>`__ -- `getCollection() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-database/get-collection.html>`__ -- `get() <{+api+}/apidocs/bson/org/bson/Document.html#get(java.lang.Object)>`__ +- `Document <{+api-root+}/bson/org/bson/Document.html>`__ +- `getCollection() <{+driver-api+}/-mongo-database/get-collection.html>`__ +- `get() <{+api-root+}/bson/org/bson/Document.html#get(java.lang.Object)>`__ BsonDocument ------------ @@ -222,11 +222,11 @@ data from the collection using the following code: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `BsonDocument <{+api+}/apidocs/bson/org/bson/BsonDocument.html>`__ -- `getCollection() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-database/get-collection.html>`__ -- `BsonInvalidOperationException <{+api+}/apidocs/bson/org/bson/BsonInvalidOperationException.html>`__ -- `get() <{+api+}/apidocs/bson/org/bson/BsonDocument.html#get(java.lang.Object)>`__ -- `BsonValue <{+api+}/apidocs/bson/org/bson/BsonValue.html>`__ +- `BsonDocument <{+api-root+}/bson/org/bson/BsonDocument.html>`__ +- `getCollection() <{+driver-api+}/-mongo-database/get-collection.html>`__ +- `BsonInvalidOperationException <{+api-root+}/bson/org/bson/BsonInvalidOperationException.html>`__ +- `get() <{+api-root+}/bson/org/bson/BsonDocument.html#get(java.lang.Object)>`__ +- `BsonValue <{+api-root+}/bson/org/bson/BsonValue.html>`__ JsonObject ---------- @@ -274,10 +274,10 @@ here is how to query your data using a ``JsonObject``: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `JsonObject <{+api+}/apidocs/bson/org/bson/json/JsonObject.html>`__ -- `JsonObjectCodec <{+api+}/apidocs/bson/org/bson/codecs/JsonObjectCodec.html>`__ -- `JsonWriterSettings <{+api+}/apidocs/bson/org/bson/json/JsonWriterSettings.html>`__ -- `getCollection() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-database/get-collection.html>`__ +- `JsonObject <{+api-root+}/bson/org/bson/json/JsonObject.html>`__ +- `JsonObjectCodec <{+api-root+}/bson/org/bson/codecs/JsonObjectCodec.html>`__ +- `JsonWriterSettings <{+api-root+}/bson/org/bson/json/JsonWriterSettings.html>`__ +- `getCollection() <{+driver-api+}/-mongo-database/get-collection.html>`__ Summary ------- diff --git a/source/fundamentals/data-formats/serialization.txt b/source/fundamentals/data-formats/serialization.txt index 16ca363a..0a95e955 100644 --- a/source/fundamentals/data-formats/serialization.txt +++ b/source/fundamentals/data-formats/serialization.txt @@ -160,8 +160,8 @@ see the following API documentation: - `KSerializer <{+kotlin-docs+}/api/kotlinx.serialization/kotlinx-serialization-core/kotlinx.serialization/-k-serializer/>`__ - `Instant <{+kotlin-docs+}/api/kotlinx-datetime/kotlinx-datetime/kotlinx.datetime/-instant/>`__ -- `BsonEncoder <{+api+}/apidocs/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-bson-encoder/index.html>`__ -- `BsonDecoder <{+api+}/apidocs/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-bson-decoder/index.html>`__ +- `BsonEncoder <{+api-root+}/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-bson-encoder/index.html>`__ +- `BsonDecoder <{+api-root+}/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-bson-decoder/index.html>`__ .. _kotlin-custom-codec: @@ -215,14 +215,14 @@ add the dependency to your project by using the :guilabel:`Gradle` and and the codec registry to support Kotlin data classes, but it does not support certain POJO annotations such as ``BsonDiscriminator``, ``BsonExtraElements``, and ``BsonConstructor``. To learn more, see - the `bson-kotlin API documentation <{+api+}/apidocs/bson-kotlin/index.html>`__. + the `bson-kotlin API documentation <{+api-root+}/bson-kotlin/index.html>`__. Generally, we recommend that you install and use the faster ``bson-kotlinx`` library for codec configuration. Then, you can define your codec using the `KotlinSerializerCodec.create() -<{+api+}/apidocs/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-kotlin-serializer-codec/-companion/index.html>`__ +<{+api-root+}/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-kotlin-serializer-codec/-companion/index.html>`__ method and add it to the registry. Custom Codec Example @@ -244,9 +244,9 @@ The following example shows how to create a codec using the For more information about the methods and classes mentioned in this section, see the following API documentation: -- `KotlinSerializerCodec <{+api+}/apidocs/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-kotlin-serializer-codec/index.html>`__ -- `KotlinSerializerCodec.create() <{+api+}/apidocs/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-kotlin-serializer-codec/-companion/create.html>`__ -- `BsonConfiguration <{+api+}/apidocs/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-bson-configuration/index.html>`__ +- `KotlinSerializerCodec <{+api-root+}/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-kotlin-serializer-codec/index.html>`__ +- `KotlinSerializerCodec.create() <{+api-root+}/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-kotlin-serializer-codec/-companion/create.html>`__ +- `BsonConfiguration <{+api-root+}/bson-kotlinx/bson-kotlinx/org.bson.codecs.kotlinx/-bson-configuration/index.html>`__ .. _kotlin-polymorphic: diff --git a/source/fundamentals/databases-collections.txt b/source/fundamentals/databases-collections.txt index d66cb796..773288cf 100644 --- a/source/fundamentals/databases-collections.txt +++ b/source/fundamentals/databases-collections.txt @@ -24,7 +24,7 @@ MongoDB organizes data into a hierarchy of the following levels: With the MongoDB Kotlin driver, you can model data by using Kotlin data classes or by using the `Document -<{+api+}/apidocs/bson/org/bson/Document.html>`__ class to store and +<{+api-root+}/bson/org/bson/Document.html>`__ class to store and retrieve data from MongoDB. To learn more about using data classes, see @@ -36,7 +36,7 @@ Access a Database ----------------- Use the `getDatabase() -<{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-cluster/get-database.html>`__ +<{+driver-api+}/-mongo-cluster/get-database.html>`__ method on a ``MongoClient`` instance to access a ``MongoDatabase`` in a MongoDB instance. @@ -49,7 +49,7 @@ Access a Collection ------------------- Use the `getCollection() -<{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-database/get-collection.html>`__ +<{+driver-api+}/-mongo-database/get-collection.html>`__ method of a ``MongoDatabase`` instance to access a ``MongoCollection`` in a database of your connected MongoDB instance. @@ -78,7 +78,7 @@ The driver provides a way for you to specify a class for documents returned from a collection, even if it is different than the class you specified when retrieving the collection. You can specify a return class by using the `MongoCollection.withDocumentClass() -<{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/with-document-class.html>`__ +<{+driver-api+}/-mongo-collection/with-document-class.html>`__ method. Specifying a different return class could be useful in the following @@ -115,7 +115,7 @@ Create a Collection ------------------- Use the `createCollection() -<{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-database/create-collection.html>`__ +<{+driver-api+}/-mongo-database/create-collection.html>`__ method of a ``MongoDatabase`` instance to create a collection in a database of your connected MongoDB instance. @@ -126,7 +126,7 @@ The following example creates a collection called ``exampleCollection``: You can specify collection options like maximum size and document validation rules using the `CreateCollectionOptions -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/CreateCollectionOptions.html>`__ +<{+core-api+}/client/model/CreateCollectionOptions.html>`__ class. The ``createCollection()`` method accepts an instance of ``CreateCollectionOptions`` as an optional second parameter. @@ -136,9 +136,9 @@ Document Validation **Document validation** provides the ability to validate documents against a series of filters during writes to a collection. You can specify these filters using the `ValidationOptions -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/ValidationOptions.html>`__ +<{+core-api+}/client/model/ValidationOptions.html>`__ class, which accepts a series of `Filters -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html>`__ instances +<{+core-api+}/client/model/Filters.html>`__ instances that specify the validation rules and expressions: .. literalinclude:: /examples/generated/DatabaseCollectionsTest.snippet.validation.kt @@ -152,7 +152,7 @@ Get a List of Collections You can query for a list of collections in a database using the `MongoDatabase.listCollectionNames() -<{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-database/list-collection-names.html>`__ method: +<{+driver-api+}/-mongo-database/list-collection-names.html>`__ method: .. io-code-block:: @@ -169,7 +169,7 @@ Drop a Collection You can remove a collection from the database using the `MongoCollection.drop() -<{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#drop()>`__ method: +<{+api-root+}/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#drop()>`__ method: .. literalinclude:: /examples/generated/DatabaseCollectionsTest.snippet.drop-collections.kt :language: kotlin @@ -200,17 +200,17 @@ of a ``MongoDatabase`` or ``MongoCollection`` with a read preference, read concern, or write concern that differs from the setting they would normally inherit: -- `MongoDatabase.withReadConcern() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-database/with-read-concern.html>`__ +- `MongoDatabase.withReadConcern() <{+driver-api+}/-mongo-database/with-read-concern.html>`__ -- `MongoDatabase.withReadPreference() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-database/with-read-preference.html>`__ +- `MongoDatabase.withReadPreference() <{+driver-api+}/-mongo-database/with-read-preference.html>`__ -- `MongoDatabase.withWriteConcern() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-database/with-write-concern.html>`__ +- `MongoDatabase.withWriteConcern() <{+driver-api+}/-mongo-database/with-write-concern.html>`__ -- `MongoCollection.withReadConcern() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/with-read-concern.html>`__ +- `MongoCollection.withReadConcern() <{+driver-api+}/-mongo-collection/with-read-concern.html>`__ -- `MongoCollection.withReadPreference() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/with-read-preference.html>`__ +- `MongoCollection.withReadPreference() <{+driver-api+}/-mongo-collection/with-read-preference.html>`__ -- `MongoCollection.withWriteConcern() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/with-write-concern.html>`__ +- `MongoCollection.withWriteConcern() <{+driver-api+}/-mongo-collection/with-write-concern.html>`__ .. tip:: diff --git a/source/fundamentals/enterprise-auth.txt b/source/fundamentals/enterprise-auth.txt index 3cfcb14c..c20fe099 100644 --- a/source/fundamentals/enterprise-auth.txt +++ b/source/fundamentals/enterprise-auth.txt @@ -160,11 +160,11 @@ You may need to specify one or more of the following additional instance and pass the property name and value as parameters. Use the property name constants defined in the ``MongoCredential`` class: - - `SERVICE_NAME_KEY <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#SERVICE_NAME_KEY>`__ - - `CANONICALIZE_HOST_NAME_KEY <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#CANONICALIZE_HOST_NAME_KEY>`__ - - `JAVA_SUBJECT_KEY <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#JAVA_SUBJECT_KEY>`__ - - `JAVA_SASL_CLIENT_PROPERTIES_KEY <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#JAVA_SASL_CLIENT_PROPERTIES_KEY>`__ - - `JAVA_SUBJECT_PROVIDER_KEY <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#JAVA_SUBJECT_PROVIDER_KEY>`__ + - `SERVICE_NAME_KEY <{+core-api+}/MongoCredential.html#SERVICE_NAME_KEY>`__ + - `CANONICALIZE_HOST_NAME_KEY <{+core-api+}/MongoCredential.html#CANONICALIZE_HOST_NAME_KEY>`__ + - `JAVA_SUBJECT_KEY <{+core-api+}/MongoCredential.html#JAVA_SUBJECT_KEY>`__ + - `JAVA_SASL_CLIENT_PROPERTIES_KEY <{+core-api+}/MongoCredential.html#JAVA_SASL_CLIENT_PROPERTIES_KEY>`__ + - `JAVA_SUBJECT_PROVIDER_KEY <{+core-api+}/MongoCredential.html#JAVA_SUBJECT_PROVIDER_KEY>`__ Select the **SERVICE_NAME_KEY** or **JAVA_SUBJECT_KEY** tab to see sample code to instantiate a ``MongoCredential`` that uses GSSAPI and diff --git a/source/fundamentals/indexes.txt b/source/fundamentals/indexes.txt index cd7084c4..0084ea27 100644 --- a/source/fundamentals/indexes.txt +++ b/source/fundamentals/indexes.txt @@ -114,13 +114,13 @@ most common index types and provide sample code for creating each index type. Fo .. tip:: The {+driver-short+} provides the `Indexes - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Indexes.html>`__ + <{+core-api+}/client/model/Indexes.html>`__ class to create and manage indexes. This class includes static factory methods to create index specification documents for different MongoDB index key types. The following examples use the -`createIndex() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/create-index.html>`__ +`createIndex() <{+driver-api+}/-mongo-collection/create-index.html>`__ method to create various indexes, and the following data classes to model data in MongoDB: @@ -260,16 +260,16 @@ each of the preceding methods. Create a Search Index +++++++++++++++++++++ -You can use the `createSearchIndex() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/create-search-index.html>`__ +You can use the `createSearchIndex() <{+driver-api+}/-mongo-collection/create-search-index.html>`__ method to create a single Atlas Search index. You *cannot* use this method to create a Vector Search index. You can use the -`createSearchIndexes() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/create-search-indexes.html>`__ +`createSearchIndexes() <{+driver-api+}/-mongo-collection/create-search-indexes.html>`__ method to create multiple Atlas Search or Vector Search indexes. You must create a `SearchIndexModel -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/SearchIndexModel.html>`__ +<{+core-api+}/client/model/SearchIndexModel.html>`__ instance for each index, then pass a list of ``SearchIndexModel`` instances to the ``createSearchIndexes()`` method. The following code example shows how to create an Atlas Search index: @@ -279,7 +279,7 @@ The following code example shows how to create an Atlas Search index: To create multiple Search or Vector Search indexes, you must create a `SearchIndexModel -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/SearchIndexModel.html>`__ +<{+core-api+}/client/model/SearchIndexModel.html>`__ instance for each index. The following code example shows how to create Search and @@ -292,7 +292,7 @@ List Search Indexes +++++++++++++++++++ You can use the -`listSearchIndexes() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/list-search-indexes.html>`__ +`listSearchIndexes() <{+driver-api+}/-mongo-collection/list-search-indexes.html>`__ method to return a list of the Atlas Search indexes on a collection. The following code example shows how to print a list of the search indexes on @@ -305,7 +305,7 @@ Update a Search Index +++++++++++++++++++++ You can use the -`updateSearchIndex() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/update-search-index.html>`__ +`updateSearchIndex() <{+driver-api+}/-mongo-collection/update-search-index.html>`__ method to update an Atlas Search index. The following code shows how to update a search index: @@ -317,7 +317,7 @@ Drop a Search Index +++++++++++++++++++ You can use the -`dropSearchIndex() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/drop-search-index.html>`__ +`dropSearchIndex() <{+driver-api+}/-mongo-collection/drop-search-index.html>`__ method to remove an Atlas Search index. The following code shows how to delete a search index from a collection: @@ -601,5 +601,5 @@ For prior versions of MongoDB, pass "*" as a parameter to your call to For more information on the methods in this section, see the following API Documentation: -- `dropIndex() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/drop-index.html>`__ -- `dropIndexes() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/drop-indexes.html>`__ +- `dropIndex() <{+driver-api+}/-mongo-collection/drop-index.html>`__ +- `dropIndexes() <{+driver-api+}/-mongo-collection/drop-indexes.html>`__ diff --git a/source/fundamentals/monitoring.txt b/source/fundamentals/monitoring.txt index a32bb48e..7c1de3e9 100644 --- a/source/fundamentals/monitoring.txt +++ b/source/fundamentals/monitoring.txt @@ -58,7 +58,7 @@ The MongoDB Kotlin driver organizes the events it defines into three categories: The following sections show how to monitor each event category. For a full list of the events you can monitor, -`see the event package of the MongoDB Kotlin driver <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/package-summary.html>`__. +`see the event package of the MongoDB Kotlin driver <{+core-api+}/event/package-summary.html>`__. .. _command-events-kotlin: @@ -131,12 +131,12 @@ counter. For more information on the classes and methods mentioned in this section, see the following API Documentation: -- `CommandListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/CommandListener.html>`__ -- `MongoClientSettings <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html>`__ -- `MongoClient <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-client/index.html>`__ -- `CommandStartedEvent <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/CommandStartedEvent.html>`__ -- `CommandSucceededEvent <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/CommandSucceededEvent.html>`__ -- `CommandFailedEvent <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/CommandFailedEvent.html>`__ +- `CommandListener <{+core-api+}/event/CommandListener.html>`__ +- `MongoClientSettings <{+core-api+}/MongoClientSettings.html>`__ +- `MongoClient <{+driver-api+}/-mongo-client/index.html>`__ +- `CommandStartedEvent <{+core-api+}/event/CommandStartedEvent.html>`__ +- `CommandSucceededEvent <{+core-api+}/event/CommandSucceededEvent.html>`__ +- `CommandFailedEvent <{+core-api+}/event/CommandFailedEvent.html>`__ Server Discovery and Monitoring Events ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -187,12 +187,12 @@ The following code adds an instance of the ``IsWritable`` class to a For more information on the classes and methods mentioned in this section, see the following API Documentation: -- `ClusterListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ClusterListener.html>`__ -- `ServerListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ServerListener.html>`__ -- `ServerMonitorListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ServerMonitorListener.html>`__ -- `MongoClientSettings <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html>`__ -- `MongoClient <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-client/index.html>`__ -- `ClusterDescriptionChangedEvent <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ClusterDescriptionChangedEvent.html>`__ +- `ClusterListener <{+core-api+}/event/ClusterListener.html>`__ +- `ServerListener <{+core-api+}/event/ServerListener.html>`__ +- `ServerMonitorListener <{+core-api+}/event/ServerMonitorListener.html>`__ +- `MongoClientSettings <{+core-api+}/MongoClientSettings.html>`__ +- `MongoClient <{+driver-api+}/-mongo-client/index.html>`__ +- `ClusterDescriptionChangedEvent <{+core-api+}/event/ClusterDescriptionChangedEvent.html>`__ Connection Pool Events ~~~~~~~~~~~~~~~~~~~~~~ @@ -236,11 +236,11 @@ librarian. For more information on the classes and methods mentioned in this section, see the following API Documentation: -- `ConnectionPoolListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ConnectionPoolListener.html>`__ -- `MongoClientSettings <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html>`__ -- `MongoClient <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-client/index.html>`__ -- `ConnectionCheckedOutEvent <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ConnectionCheckedOutEvent.html>`__ -- `ConnectionCheckOutFailedEvent <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ConnectionCheckOutFailedEvent.html>`__ +- `ConnectionPoolListener <{+core-api+}/event/ConnectionPoolListener.html>`__ +- `MongoClientSettings <{+core-api+}/MongoClientSettings.html>`__ +- `MongoClient <{+driver-api+}/-mongo-client/index.html>`__ +- `ConnectionCheckedOutEvent <{+core-api+}/event/ConnectionCheckedOutEvent.html>`__ +- `ConnectionCheckOutFailedEvent <{+core-api+}/event/ConnectionCheckOutFailedEvent.html>`__ .. _monitoring-jmx: @@ -366,7 +366,7 @@ Oracle: For more information on the ``JMXConnectionPoolListener`` class, see the API Documentation for -`JMXConnectionPoolListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/management/JMXConnectionPoolListener.html>`__. +`JMXConnectionPoolListener <{+core-api+}/management/JMXConnectionPoolListener.html>`__. Include the Driver in Your Distributed Tracing System ----------------------------------------------------- diff --git a/source/fundamentals/stable-api.txt b/source/fundamentals/stable-api.txt index fd15506e..521df9a1 100644 --- a/source/fundamentals/stable-api.txt +++ b/source/fundamentals/stable-api.txt @@ -90,14 +90,14 @@ following operations: For more information on the methods and classes referenced in this section, see the following API Documentation: -- `ServerApi <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ServerApi.html>`__ -- `ServerApi.Builder <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ServerApi.Builder.html>`__ -- `ServerApiVersion <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ServerApiVersion.html>`__ -- `ServerAddress <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ServerAddress.html>`__ -- `MongoClientSettings <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html>`__ -- `MongoClientSettings.Builder <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html>`__ -- `MongoClient.create() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-client/-factory/create.html>`__ -- `MongoClient <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-client/index.html>`__ +- `ServerApi <{+core-api+}/ServerApi.html>`__ +- `ServerApi.Builder <{+core-api+}/ServerApi.Builder.html>`__ +- `ServerApiVersion <{+core-api+}/ServerApiVersion.html>`__ +- `ServerAddress <{+core-api+}/ServerAddress.html>`__ +- `MongoClientSettings <{+core-api+}/MongoClientSettings.html>`__ +- `MongoClientSettings.Builder <{+core-api+}/MongoClientSettings.Builder.html>`__ +- `MongoClient.create() <{+driver-api+}/-mongo-client/-factory/create.html>`__ +- `MongoClient <{+driver-api+}/-mongo-client/index.html>`__ .. _versioned-api-options: .. _stable-api-options: @@ -135,6 +135,6 @@ of ``ServerApi`` by chaining methods on the ``ServerApi.Builder``: For more information on the options in this section, see the following API Documentation: -- `strict() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ServerApi.Builder.html#strict(boolean)>`__ -- `deprecationErrors() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ServerApi.Builder.html#>`__ +- `strict() <{+core-api+}/ServerApi.Builder.html#strict(boolean)>`__ +- `deprecationErrors() <{+core-api+}/ServerApi.Builder.html#>`__ diff --git a/source/fundamentals/time-series.txt b/source/fundamentals/time-series.txt index c6d99cd3..060e57a4 100644 --- a/source/fundamentals/time-series.txt +++ b/source/fundamentals/time-series.txt @@ -40,12 +40,12 @@ Create a Time Series Collection ------------------------------- To create a time series collection, pass the following parameters to the -`createCollection() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-database/create-collection.html>`__ +`createCollection() <{+driver-api+}/-mongo-database/create-collection.html>`__ method: - The name of the new collection to create -- The `TimeSeriesOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/TimeSeriesOptions.html>`__ - for creating the collection in a `CreateCollectionOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/CreateCollectionOptions.html>`__ object +- The `TimeSeriesOptions <{+core-api+}/client/model/TimeSeriesOptions.html>`__ + for creating the collection in a `CreateCollectionOptions <{+core-api+}/client/model/CreateCollectionOptions.html>`__ object .. literalinclude:: /examples/generated/TimeSeriesTest.snippet.create-time-series-collection.kt :language: kotlin @@ -55,7 +55,7 @@ method: Versions prior to MongoDB 5.0 cannot create a time series collection. To check if you successfully created the collection, send the -``"listCollections"`` command to the `runCommand() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-database/run-command.html>`__ method. +``"listCollections"`` command to the `runCommand() <{+driver-api+}/-mongo-database/run-command.html>`__ method. .. io-code-block:: diff --git a/source/fundamentals/transactions.txt b/source/fundamentals/transactions.txt index dd7317ab..62a89ea5 100644 --- a/source/fundamentals/transactions.txt +++ b/source/fundamentals/transactions.txt @@ -82,7 +82,7 @@ following methods: transaction was ended. A ``ClientSession`` also has methods to retrieve session properties and modify -mutable session properties. View the `API documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-client-session/index.html>`__ +mutable session properties. View the `API documentation <{+driver-api+}/-client-session/index.html>`__ to learn more about these methods. Example @@ -133,7 +133,7 @@ API Documentation To learn more about any of the types or methods discussed in this guide, see the following API Documentation: -- `ClientSession <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-client-session/index.html>`__ -- `startTransaction <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-client-session/start-transaction.html>`__ -- `commitTransaction <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-client-session/commit-transaction.html>`__ -- `abortTransaction <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-client-session/abort-transaction.html>`__ +- `ClientSession <{+driver-api+}/-client-session/index.html>`__ +- `startTransaction <{+driver-api+}/-client-session/start-transaction.html>`__ +- `commitTransaction <{+driver-api+}/-client-session/commit-transaction.html>`__ +- `abortTransaction <{+driver-api+}/-client-session/abort-transaction.html>`__ diff --git a/source/includes/fundamentals/auth-specify.rst b/source/includes/fundamentals/auth-specify.rst index 894a139e..f514fad6 100644 --- a/source/includes/fundamentals/auth-specify.rst +++ b/source/includes/fundamentals/auth-specify.rst @@ -25,7 +25,7 @@ authenticating using a ``MongoCredential``. For more information on these classes and methods, refer to the following API documentation: -- `MongoClient.create() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-client/-factory/create.html>`__ -- `MongoClient <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-client/index.html>`__ -- `MongoClientSettings.Builder <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html>`__ -- `MongoCredential <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html>`__ +- `MongoClient.create() <{+driver-api+}/-mongo-client/-factory/create.html>`__ +- `MongoClient <{+driver-api+}/-mongo-client/index.html>`__ +- `MongoClientSettings.Builder <{+core-api+}/MongoClientSettings.Builder.html>`__ +- `MongoCredential <{+core-api+}/MongoCredential.html>`__ diff --git a/source/index.txt b/source/index.txt index 745dde13..5128b0dd 100644 --- a/source/index.txt +++ b/source/index.txt @@ -80,16 +80,16 @@ and links to the API documentation. * - Library - Description - * - `BSON <{+api+}/apidocs/bson/index.html>`__ + * - `BSON <{+api-root+}/bson/index.html>`__ - Base BSON classes - * - `BSON Record Codec <{+api+}/apidocs/bson-record-codec/index.html>`__ + * - `BSON Record Codec <{+api-root+}/bson-record-codec/index.html>`__ - Classes that support records - * - `Core <{+api+}/apidocs/mongodb-driver-core/index.html>`__ + * - `Core <{+api-root+}/mongodb-driver-core/index.html>`__ - Shared core classes - * - `Kotlin Driver <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/index.html>`__ + * - `Kotlin Driver <{+api-root+}/mongodb-driver-kotlin-coroutine/index.html>`__ - API FAQ diff --git a/source/migrate-kmongo.txt b/source/migrate-kmongo.txt index fbf1f252..14b4aa91 100644 --- a/source/migrate-kmongo.txt +++ b/source/migrate-kmongo.txt @@ -269,7 +269,7 @@ Both drivers provide support for type-safe queries using property references. - :ref:`Builders ` - :ref:`Documents ` guide - - `JsonObject <{+api+}/apidocs/bson/org/bson/json/JsonObject.html>`__ API Documentation + - `JsonObject <{+api-root+}/bson/org/bson/json/JsonObject.html>`__ API Documentation .. tab:: :tabid: Kotlin Driver Extensions diff --git a/source/quick-reference.txt b/source/quick-reference.txt index 4730aaf2..d65a6ab4 100644 --- a/source/quick-reference.txt +++ b/source/quick-reference.txt @@ -21,7 +21,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Find a Document** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/find.html>`__ | :ref:`Usage Example ` | :ref:`Fundamentals ` @@ -39,7 +39,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Find Multiple Documents** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/find.html>`__ | :ref:`Usage Example ` | :ref:`Fundamentals ` @@ -63,7 +63,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Insert a Document** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/insert-one.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/insert-one.html>`__ | :ref:`Usage Example ` | :ref:`Fundamentals ` @@ -72,7 +72,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Insert Multiple Documents** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/insert-many.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/insert-many.html>`__ | :ref:`Usage Example ` | :ref:`Fundamentals ` @@ -81,7 +81,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Update a Document** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/update-one.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/update-one.html>`__ | :ref:`Usage Example ` | :ref:`Fundamentals ` @@ -99,7 +99,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Update Multiple Documents** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/update-many.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/update-many.html>`__ | :ref:`Usage Example ` | :ref:`Fundamentals ` @@ -123,7 +123,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Update an Array in a Document** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/update-one.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/update-one.html>`__ | :ref:`Fundamentals ` - .. io-code-block:: @@ -140,7 +140,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Replace a Document** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/replace-one.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/replace-one.html>`__ | :ref:`Usage Example ` | :ref:`Fundamentals ` @@ -158,7 +158,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Delete a Document** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/delete-one.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/delete-one.html>`__ | :ref:`Usage Example ` | :ref:`Fundamentals ` @@ -167,7 +167,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Delete Multiple Documents** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/delete-many.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/delete-many.html>`__ | :ref:`Usage Example ` | :ref:`Fundamentals ` @@ -176,7 +176,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Bulk Write** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/bulk-write.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/bulk-write.html>`__ | :ref:`Usage Example ` | :ref:`Fundamentals ` @@ -185,7 +185,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Watch for Changes** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/watch.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/watch.html>`__ | :ref:`Usage Example ` | :ref:`Fundamentals ` @@ -213,7 +213,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Count Documents** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/count-documents.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/count-documents.html>`__ | :ref:`Usage Example ` - .. io-code-block:: @@ -229,7 +229,7 @@ The examples on the page use the following data class to represent MongoDB docum 42 * - | **List the Distinct Documents or Field Values** - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/distinct.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/distinct.html>`__ | :ref:`Usage Example ` - .. io-code-block:: @@ -246,7 +246,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Limit the Number of Documents Retrieved** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/limit.html>`__ + | `API Documentation <{+driver-api+}/-find-flow/limit.html>`__ | :ref:`Fundamentals ` - .. io-code-block:: @@ -267,7 +267,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Skip Retrieved Documents** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/skip.html>`__ + | `API Documentation <{+driver-api+}/-find-flow/skip.html>`__ | :ref:`Fundamentals ` - .. io-code-block:: @@ -288,7 +288,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Sort the Documents When Retrieving Them** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/sort.html>`__ + | `API Documentation <{+driver-api+}/-find-flow/sort.html>`__ | :ref:`Fundamentals ` - .. io-code-block:: @@ -311,7 +311,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Project Document Fields When Retrieving Them** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/projection.html>`__ + | `API Documentation <{+driver-api+}/-find-flow/projection.html>`__ | :ref:`Usage Example ` | :ref:`Fundamentals ` @@ -329,7 +329,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Create an Index** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/create-index.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/create-index.html>`__ | :ref:`Fundamentals ` - .. literalinclude:: /examples/generated/QuickReferenceTest.snippet.create-index.kt @@ -337,7 +337,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Search Text** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find.html>`__ + | `API Documentation <{+driver-api+}/-mongo-collection/find.html>`__ | :ref:`Fundamentals ` - .. io-code-block:: @@ -362,7 +362,7 @@ The examples on the page use the following data class to represent MongoDB docum * - | **Access Data from a Flow Iteratively** | - | `API Documentation <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/index.html>`__ + | `API Documentation <{+driver-api+}/-find-flow/index.html>`__ | :ref:`Fundamentals ` - .. io-code-block:: diff --git a/source/quick-start.txt b/source/quick-start.txt index 114e2b78..1e5d8abf 100644 --- a/source/quick-start.txt +++ b/source/quick-start.txt @@ -238,7 +238,7 @@ Working with the Document Class (Alternative) The preceding section demonstrates how to run a query on a sample collection to retrieve data by using a Kotlin data class. This section -shows how to use the `Document <{+api+}/apidocs/bson/org/bson/Document.html>`__ class +shows how to use the `Document <{+api-root+}/bson/org/bson/Document.html>`__ class to store and retrieve data from MongoDB. In a new file called ``QuickStartDocumentExample.kt``, paste the following sample diff --git a/source/usage-examples/bulkWrite.txt b/source/usage-examples/bulkWrite.txt index 097febe8..74057073 100644 --- a/source/usage-examples/bulkWrite.txt +++ b/source/usage-examples/bulkWrite.txt @@ -95,13 +95,13 @@ page, see the following resources: - :manual:`Unique Index ` Server Manual Entry - :manual:`Schema Validation ` Server Manual Entry -- `bulkWrite() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/bulk-write.html>`__ API Documentation -- `BulkWriteOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/BulkWriteOptions.html>`__ API Documentation -- `BulkWriteResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/bulk/BulkWriteResult.html>`__ API Documentation -- `InsertOneModel <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/InsertOneModel.html>`__ API Documentation -- `UpdateOneModel <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/UpdateOneModel.html>`__ API Documentation -- `UpdateManyModel <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/UpdateManyModel.html>`__ API Documentation -- `DeleteOneModel <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/DeleteOneModel.html>`__ API Documentation -- `DeleteManyModel <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/DeleteManyModel.html>`__ API Documentation -- `ReplaceOneModel <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/ReplaceOneModel.html>`__ API Documentation +- `bulkWrite() <{+driver-api+}/-mongo-collection/bulk-write.html>`__ API Documentation +- `BulkWriteOptions <{+core-api+}/client/model/BulkWriteOptions.html>`__ API Documentation +- `BulkWriteResult <{+core-api+}/bulk/BulkWriteResult.html>`__ API Documentation +- `InsertOneModel <{+core-api+}/client/model/InsertOneModel.html>`__ API Documentation +- `UpdateOneModel <{+core-api+}/client/model/UpdateOneModel.html>`__ API Documentation +- `UpdateManyModel <{+core-api+}/client/model/UpdateManyModel.html>`__ API Documentation +- `DeleteOneModel <{+core-api+}/client/model/DeleteOneModel.html>`__ API Documentation +- `DeleteManyModel <{+core-api+}/client/model/DeleteManyModel.html>`__ API Documentation +- `ReplaceOneModel <{+core-api+}/client/model/ReplaceOneModel.html>`__ API Documentation diff --git a/source/usage-examples/command.txt b/source/usage-examples/command.txt index d71b1f72..484ae175 100644 --- a/source/usage-examples/command.txt +++ b/source/usage-examples/command.txt @@ -60,6 +60,6 @@ statistics from a specific MongoDB database. For additional information on the classes and methods mentioned on this page, see the following resources: -- `runCommand() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-database/run-command.html>`__ API Documentation +- `runCommand() <{+driver-api+}/-mongo-database/run-command.html>`__ API Documentation - :manual:`Database Commands ` Server Manual Entry - :manual:`dbStats ` Server Manual Entry diff --git a/source/usage-examples/count.txt b/source/usage-examples/count.txt index f9ce46ac..22b7f096 100644 --- a/source/usage-examples/count.txt +++ b/source/usage-examples/count.txt @@ -97,7 +97,7 @@ like this (exact numbers may vary depending on your data): For additional information on the classes and methods mentioned on this page, see the following API Documentation: -- `countDocuments() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/count-documents.html>`__ -- `estimatedDocumentCount() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/estimated-document-count.html>`__ -- `CountOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/CountOptions.html>`__ -- `EstimatedDocumentCountOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/EstimatedDocumentCountOptions.html>`__ +- `countDocuments() <{+driver-api+}/-mongo-collection/count-documents.html>`__ +- `estimatedDocumentCount() <{+driver-api+}/-mongo-collection/estimated-document-count.html>`__ +- `CountOptions <{+core-api+}/client/model/CountOptions.html>`__ +- `EstimatedDocumentCountOptions <{+core-api+}/client/model/EstimatedDocumentCountOptions.html>`__ diff --git a/source/usage-examples/deleteMany.txt b/source/usage-examples/deleteMany.txt index a1e6c9aa..251e456e 100644 --- a/source/usage-examples/deleteMany.txt +++ b/source/usage-examples/deleteMany.txt @@ -52,6 +52,6 @@ documents deleted in your call to ``deleteMany()``. For additional information on the classes and methods mentioned on this page, see the following API Documentation: -- `deleteMany() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/delete-many.html>`__ -- `DeleteResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/DeleteResult.html>`__ -- `drop() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#drop()>`__ +- `deleteMany() <{+driver-api+}/-mongo-collection/delete-many.html>`__ +- `DeleteResult <{+core-api+}/client/result/DeleteResult.html>`__ +- `drop() <{+api-root+}/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#drop()>`__ diff --git a/source/usage-examples/deleteOne.txt b/source/usage-examples/deleteOne.txt index 7625a883..0718e1cc 100644 --- a/source/usage-examples/deleteOne.txt +++ b/source/usage-examples/deleteOne.txt @@ -51,6 +51,6 @@ your call to ``deleteOne()`` removes no documents and returns the following: For additional information on the classes and methods mentioned on this page, see the following API Documentation: -- `deleteOne() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/delete-one.html>`__ -- `DeleteResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/DeleteResult.html>`__ -- `eq() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#eq(java.lang.String,TItem)>`__ +- `deleteOne() <{+driver-api+}/-mongo-collection/delete-one.html>`__ +- `DeleteResult <{+core-api+}/client/result/DeleteResult.html>`__ +- `eq() <{+core-api+}/client/model/Filters.html#eq(java.lang.String,TItem)>`__ diff --git a/source/usage-examples/distinct.txt b/source/usage-examples/distinct.txt index b34ef2a8..94be2cde 100644 --- a/source/usage-examples/distinct.txt +++ b/source/usage-examples/distinct.txt @@ -74,6 +74,6 @@ year for all the movies that Carl Franklin was included as a director. For additional information on the classes and methods mentioned on this page, see the following resources: -- `distinct() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/distinct.html>`__ API Documentation -- `distinctFlow <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-distinct-flow/index.html>`__ API Documentation +- `distinct() <{+driver-api+}/-mongo-collection/distinct.html>`__ API Documentation +- `distinctFlow <{+driver-api+}/-distinct-flow/index.html>`__ API Documentation - :manual:`Dot Notation ` Server Manual Entry diff --git a/source/usage-examples/find.txt b/source/usage-examples/find.txt index a9b5824c..305e8c7c 100644 --- a/source/usage-examples/find.txt +++ b/source/usage-examples/find.txt @@ -61,6 +61,6 @@ the ``movies`` collection. It uses the following objects and methods: For additional information on the classes and methods mentioned on this page, see the following API Documentation: -- `FindFlow <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/index.html>`__ -- `find() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find.html>`__ +- `FindFlow <{+driver-api+}/-find-flow/index.html>`__ +- `find() <{+driver-api+}/-mongo-collection/find.html>`__ diff --git a/source/usage-examples/findOne.txt b/source/usage-examples/findOne.txt index 1a520311..ff7ad412 100644 --- a/source/usage-examples/findOne.txt +++ b/source/usage-examples/findOne.txt @@ -61,6 +61,6 @@ It uses the following objects and methods: For additional information on the classes and methods mentioned on this page, see the following API Documentation: -- `FindFlow <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-find-flow/index.html>`__ -- `find() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/find.html>`__ +- `FindFlow <{+driver-api+}/-find-flow/index.html>`__ +- `find() <{+driver-api+}/-mongo-collection/find.html>`__ diff --git a/source/usage-examples/insertMany.txt b/source/usage-examples/insertMany.txt index 7e965fff..0e12bbb3 100644 --- a/source/usage-examples/insertMany.txt +++ b/source/usage-examples/insertMany.txt @@ -45,6 +45,6 @@ When you run the example, you should see output with the inserted documents' For additional information on the classes and methods mentioned on this page, see the following API Documentation: -- `insertMany() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/insert-many.html>`__ -- `Document <{+api+}/apidocs/bson/org/bson/Document.html>`__ -- `InsertManyResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/InsertManyResult.html>`__ +- `insertMany() <{+driver-api+}/-mongo-collection/insert-many.html>`__ +- `Document <{+api-root+}/bson/org/bson/Document.html>`__ +- `InsertManyResult <{+core-api+}/client/result/InsertManyResult.html>`__ diff --git a/source/usage-examples/insertOne.txt b/source/usage-examples/insertOne.txt index 5a72474a..cf79fd81 100644 --- a/source/usage-examples/insertOne.txt +++ b/source/usage-examples/insertOne.txt @@ -45,7 +45,7 @@ When you run the example, you should see output with the inserted document's For additional information on the classes and methods mentioned on this page, see the following API Documentation: -- `insertOne() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/insert-one.html>`__ -- `Document <{+api+}/apidocs/bson/org/bson/Document.html>`__ -- `InsertOneResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/InsertOneResult.html>`__ +- `insertOne() <{+driver-api+}/-mongo-collection/insert-one.html>`__ +- `Document <{+api-root+}/bson/org/bson/Document.html>`__ +- `InsertOneResult <{+core-api+}/client/result/InsertOneResult.html>`__ diff --git a/source/usage-examples/replaceOne.txt b/source/usage-examples/replaceOne.txt index f9ff8bd3..a0debfa5 100644 --- a/source/usage-examples/replaceOne.txt +++ b/source/usage-examples/replaceOne.txt @@ -109,7 +109,7 @@ If you query the replaced document, it should look something like this: For additional information on the classes and methods mentioned on this page, see the following API Documentation: -- `ReplaceOne <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/replace-one.html>`__ -- `ReplaceOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/ReplaceOptions.html?is-external=true>`__ -- `UpdateResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/UpdateResult.html>`__ -- `eq() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html#eq(java.lang.String,TItem)>`__ +- `ReplaceOne <{+driver-api+}/-mongo-collection/replace-one.html>`__ +- `ReplaceOptions <{+core-api+}/client/model/ReplaceOptions.html?is-external=true>`__ +- `UpdateResult <{+core-api+}/client/result/UpdateResult.html>`__ +- `eq() <{+core-api+}/client/model/Filters.html#eq(java.lang.String,TItem)>`__ diff --git a/source/usage-examples/updateMany.txt b/source/usage-examples/updateMany.txt index ace9a0fb..ae39b0f7 100644 --- a/source/usage-examples/updateMany.txt +++ b/source/usage-examples/updateMany.txt @@ -100,9 +100,9 @@ this: For additional information on the classes and methods mentioned on this page, see the following API Documentation: -- `UpdateMany <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/update-many.html>`__ -- `UpdateOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/UpdateOptions.html>`__ -- `combine() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#combine(org.bson.conversions.Bson...)>`__ -- `addToSet() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#addToSet(java.lang.String,TItem)>`__ -- `currentDate() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#currentDate(java.lang.String)>`__ -- `UpdateResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/UpdateResult.html>`__ +- `UpdateMany <{+driver-api+}/-mongo-collection/update-many.html>`__ +- `UpdateOptions <{+core-api+}/client/model/UpdateOptions.html>`__ +- `combine() <{+core-api+}/client/model/Updates.html#combine(org.bson.conversions.Bson...)>`__ +- `addToSet() <{+core-api+}/client/model/Updates.html#addToSet(java.lang.String,TItem)>`__ +- `currentDate() <{+core-api+}/client/model/Updates.html#currentDate(java.lang.String)>`__ +- `UpdateResult <{+core-api+}/client/result/UpdateResult.html>`__ diff --git a/source/usage-examples/updateOne.txt b/source/usage-examples/updateOne.txt index 471a7a40..d53de658 100644 --- a/source/usage-examples/updateOne.txt +++ b/source/usage-examples/updateOne.txt @@ -101,10 +101,10 @@ If you query the updated document, it should look something like this: For additional information on the classes and methods mentioned on this page, see the following API Documentation: -- `UpdateOne <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/update-one.html>`__ -- `UpdateOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/UpdateOptions.html>`__ -- `combine() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#combine(org.bson.conversions.Bson...)>`__ -- `set() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#set(java.lang.String,TItem)>`__ -- `addToSet() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#addToSet(java.lang.String,TItem)>`__ -- `currentDate() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#currentDate(java.lang.String)>`__ -- `UpdateResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/UpdateResult.html>`__ +- `UpdateOne <{+driver-api+}/-mongo-collection/update-one.html>`__ +- `UpdateOptions <{+core-api+}/client/model/UpdateOptions.html>`__ +- `combine() <{+core-api+}/client/model/Updates.html#combine(org.bson.conversions.Bson...)>`__ +- `set() <{+core-api+}/client/model/Updates.html#set(java.lang.String,TItem)>`__ +- `addToSet() <{+core-api+}/client/model/Updates.html#addToSet(java.lang.String,TItem)>`__ +- `currentDate() <{+core-api+}/client/model/Updates.html#currentDate(java.lang.String)>`__ +- `UpdateResult <{+core-api+}/client/result/UpdateResult.html>`__ diff --git a/source/usage-examples/watch.txt b/source/usage-examples/watch.txt index 772b3cb9..b0915225 100644 --- a/source/usage-examples/watch.txt +++ b/source/usage-examples/watch.txt @@ -100,7 +100,7 @@ page, see the following resources: - :manual:`Change Events ` Server Manual Entry - :manual:`Aggregation Pipeline ` Server Manual Entry - :manual:`Aggregation Stages ` Server Manual Entry -- `ChangeStreamFlow <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-change-stream-flow/index.html>`__ API Documentation -- `MongoCollection.watch() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-collection/watch.html>`__ API Documentation -- `MongoDatabase.watch() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-database/watch.html>`__ API Documentation -- `MongoClient.watch() <{+api+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-cluster/watch.html>`__ API Documentation +- `ChangeStreamFlow <{+driver-api+}/-change-stream-flow/index.html>`__ API Documentation +- `MongoCollection.watch() <{+driver-api+}/-mongo-collection/watch.html>`__ API Documentation +- `MongoDatabase.watch() <{+driver-api+}/-mongo-database/watch.html>`__ API Documentation +- `MongoClient.watch() <{+driver-api+}/-mongo-cluster/watch.html>`__ API Documentation diff --git a/source/whats-new.txt b/source/whats-new.txt index 4b5bd206..79ac2ec7 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -46,7 +46,7 @@ and features: .. replacement:: atlas-query-operators - the `SearchOperator <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/search/SearchOperator.html>`__ + the `SearchOperator <{+core-api+}/client/model/search/SearchOperator.html>`__ interface API documentation .. _kotlin-coroutine-version-5.3: @@ -73,7 +73,7 @@ improvements, and fixes: - Support for using builders class methods directly with data class properties. To learn more, see the :ref:`kotlin-builders-data-classes` guide. This functionality is supported by the `{+driver-short+} - Extensions package <{+api+}/apidocs/mongodb-driver-kotlin-extensions/index.html>`__ + Extensions package <{+api-root+}/mongodb-driver-kotlin-extensions/index.html>`__ published with this release. - Implements a *client* bulk write API that allows you to perform write @@ -100,7 +100,7 @@ improvements, and fixes: .. replacement:: csot-link the `MongoClientSettings.Builder.timeout() - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#timeout(long,java.util.concurrent.TimeUnit)>`__ + <{+core-api+}/MongoClientSettings.Builder.html#timeout(long,java.util.concurrent.TimeUnit)>`__ API documentation .. replacement:: avs-index-link @@ -272,7 +272,7 @@ The 4.11 driver release deprecates the following items: - The following network address-related methods are deprecated and will be removed in v5.0: - - The `ServerAddress <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ServerAddress.html>`__ + - The `ServerAddress <{+core-api+}/ServerAddress.html>`__ methods ``getSocketAddress()`` and ``getSocketAddresses()``. Instead of ``getSocketAddress()``, use the ``getByName()`` instance @@ -281,7 +281,7 @@ The 4.11 driver release deprecates the following items: Instead of ``getSocketAddresses()``, use the ``getAllByName()`` instance method of ``java.net.InetAddress``. - - The `UnixServerAddress <{+api+}/apidocs/mongodb-driver-core/com/mongodb/UnixServerAddress.html>`__ + - The `UnixServerAddress <{+core-api+}/UnixServerAddress.html>`__ method ``getUnixSocketAddress()``. Instead of ``getUnixSocketAddress()``, construct an instance of @@ -323,7 +323,7 @@ The 4.11 driver release deprecates the following items: .streamFactoryFactory(NettyStreamFactoryFactory.builder().build()) .build(); - Replace this code with the `TransportSettings.nettyBuilder() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/connection/TransportSettings.html>`__ + Replace this code with the `TransportSettings.nettyBuilder() <{+core-api+}/connection/TransportSettings.html>`__ as shown in the following example: .. code-block:: java @@ -357,9 +357,9 @@ New features of the 4.11 driver release include: - Added ``getElapsedTime()`` methods to the following classes to monitor the duration of connection pool events: - - `ConnectionCheckOutFailedEvent <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ConnectionCheckOutFailedEvent.html>`__ - - `ConnectionCheckedOutEvent <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ConnectionCheckedOutEvent.html>`__ - - `ConnectionReadyEvent <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ConnectionReadyEvent.html>`__ + - `ConnectionCheckOutFailedEvent <{+core-api+}/event/ConnectionCheckOutFailedEvent.html>`__ + - `ConnectionCheckedOutEvent <{+core-api+}/event/ConnectionCheckedOutEvent.html>`__ + - `ConnectionReadyEvent <{+core-api+}/event/ConnectionReadyEvent.html>`__ - Support for Java 21 virtual threads and structured concurrency. The driver internals were updated to avoid unnecessary pinning of virtual threads @@ -373,9 +373,9 @@ New features of the 4.11 driver release include: - Updated API documentation for the following types: - - `ClusterListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ClusterListener.html>`__ - - `ServerListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ServerListener.html>`__ - - `ServerMonitorListener <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/ServerMonitorListener.html>`__ + - `ClusterListener <{+core-api+}/event/ClusterListener.html>`__ + - `ServerListener <{+core-api+}/event/ServerListener.html>`__ + - `ServerMonitorListener <{+core-api+}/event/ServerMonitorListener.html>`__ .. _version-4.10: From 3117ae8f3174390f6bf05fd8710691df2371b306 Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 31 Mar 2025 14:37:41 -0400 Subject: [PATCH 03/13] CSOT (cherry picked from commit 971937e5195eb3d195f269305e3706a9b15b59d0) --- examples/src/test/kotlin/CompoundTest.kt | 3 +- examples/src/test/kotlin/CsotTest.kt | 144 +++++++++ .../CompoundTest.snippet.find-one-update.kt | 1 - ...tTest.snippet.connection-string-timeout.kt | 2 + .../CsotTest.snippet.cursor-lifetime.kt | 3 + ...est.snippet.mongoclientsettings-timeout.kt | 6 + .../generated/CsotTest.snippet.operation.kt | 11 + .../generated/CsotTest.snippet.override.kt | 10 + .../generated/CsotTest.snippet.session.kt | 6 + .../generated/CsotTest.snippet.transaction.kt | 3 + source/fundamentals/connection.txt | 2 + .../connection/connection-options.txt | 28 +- source/fundamentals/connection/csot.txt | 281 ++++++++++++++++++ .../crud/read-operations/flow.txt | 6 + source/fundamentals/transactions.txt | 6 + source/usage-examples/count.txt | 14 +- 16 files changed, 511 insertions(+), 15 deletions(-) create mode 100644 examples/src/test/kotlin/CsotTest.kt create mode 100644 source/examples/generated/CsotTest.snippet.connection-string-timeout.kt create mode 100644 source/examples/generated/CsotTest.snippet.cursor-lifetime.kt create mode 100644 source/examples/generated/CsotTest.snippet.mongoclientsettings-timeout.kt create mode 100644 source/examples/generated/CsotTest.snippet.operation.kt create mode 100644 source/examples/generated/CsotTest.snippet.override.kt create mode 100644 source/examples/generated/CsotTest.snippet.session.kt create mode 100644 source/examples/generated/CsotTest.snippet.transaction.kt create mode 100644 source/fundamentals/connection/csot.txt diff --git a/examples/src/test/kotlin/CompoundTest.kt b/examples/src/test/kotlin/CompoundTest.kt index d230f67a..123d8d41 100644 --- a/examples/src/test/kotlin/CompoundTest.kt +++ b/examples/src/test/kotlin/CompoundTest.kt @@ -81,7 +81,6 @@ internal class CompoundOperationsTest { val update = Updates.set(FoodOrder::food.name, "pizza") val options = FindOneAndUpdateOptions() .upsert(true) - .maxTime(5, TimeUnit.SECONDS) /* The result variable contains your document in the state before your update operation is performed or null if the document was inserted due to upsert @@ -183,4 +182,4 @@ internal class CompoundOperationsTest { assertEquals("joe", roomAfterSafe.first().guest) assertTrue(roomAfterSafe.first().reserved) } -} \ No newline at end of file +} diff --git a/examples/src/test/kotlin/CsotTest.kt b/examples/src/test/kotlin/CsotTest.kt new file mode 100644 index 00000000..98f34f80 --- /dev/null +++ b/examples/src/test/kotlin/CsotTest.kt @@ -0,0 +1,144 @@ + +import com.mongodb.ClientSessionOptions +import com.mongodb.ConnectionString +import com.mongodb.MongoClientSettings +import com.mongodb.TransactionOptions +import com.mongodb.client.cursor.TimeoutMode +import com.mongodb.client.model.Filters +import com.mongodb.kotlin.client.coroutine.MongoClient +import config.getConfig +import kotlinx.coroutines.runBlocking +import org.bson.Document +import org.junit.jupiter.api.AfterAll +import org.junit.jupiter.api.BeforeAll +import org.junit.jupiter.api.Test +import java.util.concurrent.TimeUnit +import kotlin.test.Ignore + +class CsotTest { + + companion object { + val config = getConfig() + val CONNECTION_URI_PLACEHOLDER = config.connectionUri + val client = MongoClient.create(CONNECTION_URI_PLACEHOLDER) + val database = client.getDatabase("db") + val collection = database.getCollection("people") + + @BeforeAll + @JvmStatic + fun beforeAll() { + runBlocking { + val people = listOf( + Document("name", "Shelley Price").append("age", 56), + Document("name", "Garrett John").append("age", 39), + Document("name", "Kalima Sheik").append("age", 26) + ) + collection.insertMany(people) + } + } + + @AfterAll + @JvmStatic + fun afterAll() { + runBlocking { + database.drop() + client.close() + } + } + } + + @Ignore + fun connectionStringTest() = runBlocking { + // :snippet-start: connection-string-timeout + val uri = "/?timeoutMS=200" + val client = MongoClient.create(uri) + // :snippet-end: + } + + // :replace-start: { + // "terms": { + // "uri": "\"\"" + // } + // } + + @Test + fun mongoClientSettingsTest() = runBlocking { + val uri = CONNECTION_URI_PLACEHOLDER + // :snippet-start: mongoclientsettings-timeout + val settings = MongoClientSettings.builder() + .applyConnectionString(ConnectionString(uri)) + .timeout(200L, TimeUnit.MILLISECONDS) + .build() + + val client = MongoClient.create(settings) + // :snippet-end: + } + + @Test + fun operationTimeoutTest() = runBlocking { + val uri = CONNECTION_URI_PLACEHOLDER + // :snippet-start: operation + val settings = MongoClientSettings.builder() + .applyConnectionString(ConnectionString(uri)) + .timeout(200L, TimeUnit.MILLISECONDS) + .build() + + val client = MongoClient.create(settings) + val collection = client + .getDatabase("db") + .getCollection("people") + + collection.insertOne(Document("name", "Francine Loews")) + // :snippet-end: + } + + @Test + fun overrideTimeoutTest() = runBlocking { + val uri = CONNECTION_URI_PLACEHOLDER + // :snippet-start: override + val settings = MongoClientSettings.builder() + .applyConnectionString(ConnectionString(uri)) + .timeout(200L, TimeUnit.MILLISECONDS) + .build() + + val client = MongoClient.create(settings) + val database = client.getDatabase("db") + val collection = database + .getCollection("people") + .withTimeout(300L, TimeUnit.MILLISECONDS) + // :snippet-end: + } + + @Test + fun transactionTimeoutTest() = runBlocking { + // :snippet-start: session + val opts = ClientSessionOptions.builder() + .defaultTimeout(200L, TimeUnit.MILLISECONDS) + .build() + + val session = client.startSession(opts) + // ... perform operations on ClientSession + // :snippet-end: + + // :snippet-start: transaction + val transactionOptions = TransactionOptions.builder() + .timeout(200L, TimeUnit.MILLISECONDS) + .build() + // :snippet-end: + } + + @Test + fun cursorTimeoutTest() = runBlocking { + val collection = database + .getCollection("people") + .withTimeout(200L, TimeUnit.MILLISECONDS) + + // :snippet-start: cursor-lifetime + val flowWithLifetimeTimeout = collection + .find(Filters.gte("age", 40)) + .timeoutMode(TimeoutMode.CURSOR_LIFETIME) + // :snippet-end: + } +} + +// :replace-end: \ No newline at end of file diff --git a/source/examples/generated/CompoundTest.snippet.find-one-update.kt b/source/examples/generated/CompoundTest.snippet.find-one-update.kt index 26956d31..e7aac085 100644 --- a/source/examples/generated/CompoundTest.snippet.find-one-update.kt +++ b/source/examples/generated/CompoundTest.snippet.find-one-update.kt @@ -3,7 +3,6 @@ val filter = Filters.eq(FoodOrder::color.name, "green") val update = Updates.set(FoodOrder::food.name, "pizza") val options = FindOneAndUpdateOptions() .upsert(true) - .maxTime(5, TimeUnit.SECONDS) /* The result variable contains your document in the state before your update operation is performed or null if the document was inserted due to upsert diff --git a/source/examples/generated/CsotTest.snippet.connection-string-timeout.kt b/source/examples/generated/CsotTest.snippet.connection-string-timeout.kt new file mode 100644 index 00000000..75a3a422 --- /dev/null +++ b/source/examples/generated/CsotTest.snippet.connection-string-timeout.kt @@ -0,0 +1,2 @@ +val uri = "/?timeoutMS=200" +val client = MongoClient.create(uri) diff --git a/source/examples/generated/CsotTest.snippet.cursor-lifetime.kt b/source/examples/generated/CsotTest.snippet.cursor-lifetime.kt new file mode 100644 index 00000000..c48d045b --- /dev/null +++ b/source/examples/generated/CsotTest.snippet.cursor-lifetime.kt @@ -0,0 +1,3 @@ +val flowWithLifetimeTimeout = collection + .find(Filters.gte("age", 40)) + .timeoutMode(TimeoutMode.CURSOR_LIFETIME) diff --git a/source/examples/generated/CsotTest.snippet.mongoclientsettings-timeout.kt b/source/examples/generated/CsotTest.snippet.mongoclientsettings-timeout.kt new file mode 100644 index 00000000..3d6c7176 --- /dev/null +++ b/source/examples/generated/CsotTest.snippet.mongoclientsettings-timeout.kt @@ -0,0 +1,6 @@ +val settings = MongoClientSettings.builder() + .applyConnectionString(ConnectionString("")) + .timeout(200L, TimeUnit.MILLISECONDS) + .build() + +val client = MongoClient.create(settings) diff --git a/source/examples/generated/CsotTest.snippet.operation.kt b/source/examples/generated/CsotTest.snippet.operation.kt new file mode 100644 index 00000000..986abf30 --- /dev/null +++ b/source/examples/generated/CsotTest.snippet.operation.kt @@ -0,0 +1,11 @@ +val settings = MongoClientSettings.builder() + .applyConnectionString(ConnectionString("")) + .timeout(200L, TimeUnit.MILLISECONDS) + .build() + +val client = MongoClient.create(settings) +val collection = client + .getDatabase("db") + .getCollection("people") + +collection.insertOne(Document("name", "Francine Loews")) diff --git a/source/examples/generated/CsotTest.snippet.override.kt b/source/examples/generated/CsotTest.snippet.override.kt new file mode 100644 index 00000000..8baedb17 --- /dev/null +++ b/source/examples/generated/CsotTest.snippet.override.kt @@ -0,0 +1,10 @@ +val settings = MongoClientSettings.builder() + .applyConnectionString(ConnectionString("")) + .timeout(200L, TimeUnit.MILLISECONDS) + .build() + +val client = MongoClient.create(settings) +val database = client.getDatabase("db") +val collection = database + .getCollection("people") + .withTimeout(300L, TimeUnit.MILLISECONDS) diff --git a/source/examples/generated/CsotTest.snippet.session.kt b/source/examples/generated/CsotTest.snippet.session.kt new file mode 100644 index 00000000..3c86cbd2 --- /dev/null +++ b/source/examples/generated/CsotTest.snippet.session.kt @@ -0,0 +1,6 @@ +val opts = ClientSessionOptions.builder() + .defaultTimeout(200L, TimeUnit.MILLISECONDS) + .build() + +val session = client.startSession(opts) +// ... perform operations on ClientSession diff --git a/source/examples/generated/CsotTest.snippet.transaction.kt b/source/examples/generated/CsotTest.snippet.transaction.kt new file mode 100644 index 00000000..234aee48 --- /dev/null +++ b/source/examples/generated/CsotTest.snippet.transaction.kt @@ -0,0 +1,3 @@ +val transactionOptions = TransactionOptions.builder() + .timeout(200L, TimeUnit.MILLISECONDS) + .build() diff --git a/source/fundamentals/connection.txt b/source/fundamentals/connection.txt index 8aed7e10..db49932d 100644 --- a/source/fundamentals/connection.txt +++ b/source/fundamentals/connection.txt @@ -9,6 +9,7 @@ Connection Guide Connect to MongoDB Connection Options MongoClient Settings + Limit Execution Time Network Compression TLS/SSL SOCKS5 Proxy Connection @@ -29,6 +30,7 @@ sections: - :ref:`Connect to MongoDB ` - :ref:`View a List of Connection Options ` - :ref:`Specify Connection Behavior with the MongoClient Class ` +- :ref:`Limit Server Execution Time ` - :ref:`Enable Network Compression ` - :ref:`Enable TLS/SSL on a Connection ` - :ref:`Connect to MongoDB by Using a SOCKS5 Proxy ` diff --git a/source/fundamentals/connection/connection-options.txt b/source/fundamentals/connection/connection-options.txt index bc539c6e..5baa6f31 100644 --- a/source/fundamentals/connection/connection-options.txt +++ b/source/fundamentals/connection/connection-options.txt @@ -30,10 +30,15 @@ parameters of the connection URI to specify the behavior of the client. | **Default**: ``100`` - * - **waitQueueTimeoutMS** + * - **waitQueueTimeoutMS** *(deprecated)* - integer - - Specifies the maximum amount of time, in milliseconds that a - thread may wait for a connection to become available. + - This option is deprecated. You can configure this timeout by + setting the the :ref:`client-level timeout ` + instead. + + Maximum wait time in milliseconds that an operation can wait for + a connection to become available. A value of ``0`` means there + is no limit. | **Default**: ``120000`` (120 seconds) @@ -111,9 +116,13 @@ parameters of the connection URI to specify the behavior of the client. | **Default**: ``10000`` (10 seconds) - * - **socketTimeoutMS** + * - **socketTimeoutMS** *(deprecated)* - integer - - Specifies the maximum amount of time, in milliseconds, the Kotlin + - This option is deprecated. You can configure this timeout by + setting the the :ref:`client-level timeout ` + instead. + + Maximum amount of time, in milliseconds, the Kotlin driver will wait to send or receive a request before timing out. A value of ``0`` instructs the driver to never time out while waiting to send or receive a request. @@ -153,9 +162,14 @@ parameters of the connection URI to specify the behavior of the client. | **Default**: ``1`` - * - **wtimeoutMS** + * - **wtimeoutMS** *(deprecated)* - integer - - Specifies a time limit, in milliseconds, for the write concern. For + + - This option is deprecated. You can configure this timeout by + setting the the :ref:`client-level timeout ` + instead. + + Time limit, in milliseconds, for the write concern. For more information, see the server documentation for the :manual:`wtimeoutMS option `. A value of ``0`` instructs the driver to never time out write operations. diff --git a/source/fundamentals/connection/csot.txt b/source/fundamentals/connection/csot.txt new file mode 100644 index 00000000..17c6c6c7 --- /dev/null +++ b/source/fundamentals/connection/csot.txt @@ -0,0 +1,281 @@ +.. _kotlin-csot: + +=========================== +Limit Server Execution Time +=========================== + +.. contents:: On this page + :local: + :backlinks: none + :depth: 2 + :class: singlecol + +.. facet:: + :name: genre + :values: reference + +.. meta:: + :keywords: error, blocking, thread, task, code example + +Overview +-------- + +When you use the {+driver-short+} to perform a server operation, you can also +limit the amount of time in which the server can finish the operation. To do so, +specify a **client-side operation timeout (CSOT)**. The timeout applies to all +steps needed to complete the operation, including server selection, connection +checkout, and server-side execution. When the timeout expires, the +{+driver-short+} raises a timeout exception. + +.. note:: Experimental Feature + + The CSOT feature is experimental and might change in future driver + releases. + +timeoutMS Option +---------------- + +To specify a timeout when connecting to a MongoDB deployment, set the +``timeoutMS`` connection option to the timeout length in milliseconds. You can +set the ``timeoutMS`` option in the following ways: + +- Calling the ``timeout()`` method from the + ``MongoClientSettings.Builder`` class +- Setting the ``timeoutMS`` parameter in your connection string + +The following code examples set a client-level timeout of ``200`` milliseconds. +Select the :guilabel:`MongoClientSettings` or :guilabel:`Connection +String` tab to see the corresponding code. + +.. tabs:: + + .. tab:: MongoClientSettings + :tabid: mongoclientsettings + + .. literalinclude:: /examples/generated/CsotTest.snippet.mongoclientsettings-timeout.kt + :language: kotlin + :emphasize-lines: 3 + + .. tab:: Connection String + :tabid: connection-string + + .. literalinclude:: /examples/generated/CsotTest.snippet.connection-string-timeout.kt + :language: kotlin + +Accepted Timeout Values +~~~~~~~~~~~~~~~~~~~~~~~ + +The following table describes the timeout behavior corresponding to the +accepted values for ``timeoutMS``: + +.. list-table:: + :header-rows: 1 + :widths: 25 75 + + * - Value + - Behavior + + * - Positive integer + - Sets the timeout to use for operation completion. + + * - ``0`` + - Specifies that operations never time out. + + * - ``null`` or unset + - | Defers the timeout behavior to the following settings: + + - :manual:`waitQueueTimeoutMS ` + - :manual:`socketTimeoutMS ` + - :manual:`wTimeoutMS ` + - :manual:`maxTimeMS ` + - `maxCommitTimeMS <{+core-api+}/TransactionOptions.Builder.html#maxCommitTime(java.lang.Long,java.util.concurrent.TimeUnit)>`__ + + | These settings are deprecated and are ignored if you set ``timeoutMS``. + +If you specify the ``timeoutMS`` option, the driver automatically applies the +specified timeout to each server operation. The following code example specifies +a timeout of ``200`` milliseconds at the client level, and then calls the +``MongoCollection.insertOne()`` method: + +.. literalinclude:: /examples/generated/CsotTest.snippet.operation.kt + :language: kotlin + +Timeout Inheritance +~~~~~~~~~~~~~~~~~~~ + +When you specify the ``timeoutMS`` option, the driver applies the timeout +according to the same inheritance behaviors as the other {+driver-short+} options. +The following table describes how the timeout value is inherited at each level: + +.. list-table:: + :header-rows: 1 + :widths: 30 70 + + * - Level + - Inheritance Description + + * - Operation + - Takes the highest precedence and overrides the timeout + options that you set at any other level. + + * - Transaction + - Takes precedence over the timeout value that you set at the session, + collection, database, or client level. + + * - Session + - Applies to all transactions and operations within + that session, unless you set a different timeout value at those + levels. + + * - Database + - Applies to all sessions and operations within that + database, unless you set a different timeout value at those + levels. + + * - Collection + - Applies to all sessions and operations on that + collection, unless you set a different timeout value at those + levels. + + * - Client + - Applies to all databases, collections, sessions, transactions, and + operations within that client that do not otherwise specify + ``timeoutMS``. + +For more information on overrides and specific options, see the following +:ref:`kotlin-csot-overrides` section. + +.. _kotlin-csot-overrides: + +Overrides +--------- + +The {+driver-short+} supports various levels of configuration to control the +behavior and performance of database operations. + +You can specify a ``timeoutMS`` option at a more specific level to override the +client-level configuration. The table in the preceding section describes +the levels at which you can specify a timeout setting. This allows you +to customize timeouts based on the needs of individual operations. + +The following example demonstrates how a collection-level timeout +configuration can override a client-level timeout configuration: + +.. literalinclude:: /examples/generated/CsotTest.snippet.override.kt + :language: kotlin + :emphasize-lines: 10 + +.. _kotlin-csot-transaction: + +Transactions +~~~~~~~~~~~~ + +When you create a new `ClientSession <{+driver-api+}/-client-session/index.html>`__ +instance to implement a transaction, use the ``defaultTimeout()`` method +when building a ``ClientSessionOptions`` instance. You can use this +option to specify the timeout for the following methods: + +- `commitTransaction() <{+driver-api+}/-client-session/commit-transaction.html>`__ +- `abortTransaction() <{+driver-api+}/-client-session/abort-transaction.html>`__ +- `withTransaction() <{+driver-api+}/-client-session/with-transaction.html>`__ +- `close() <{+core-api+}/session/ClientSession.html#close()>`__ + +The following code demonstrates how to set the ``defaultTimeout`` when +instantiating a ``ClientSession``: + +.. literalinclude:: /examples/generated/CsotTest.snippet.session.kt + :language: kotlin + +If you do not specify the ``defaultTimeout``, the driver uses the timeout +value set on the parent ``MongoClient``. + +You can also set a transaction-level timeout by calling the ``timeout()`` +method when building a ``TransactionOptions`` instance. Setting this +option applies a timeout to all operations performed in the scope of the +transaction: + +.. literalinclude:: /examples/generated/CsotTest.snippet.transaction.kt + :language: kotlin + +To learn more about transactions, see the +:ref:`kotlin-fundamentals-transactions` guide. + +Client Encryption +~~~~~~~~~~~~~~~~~ + +When you use Client-Side Field Level Encryption (CSFLE), the driver uses the +``timeoutMS`` option to limit the time allowed for encryption and decryption +operations. You can set a timeout option for your ``ClientEncryption`` +instance by calling the ``timeout()`` method when building a +``ClientEncryptionSettings`` instance. + +If you specify the timeout when you construct a +``ClientEncryption`` instance, the timeout controls the lifetime of all operations +performed on that instance. If you do not provide a timeout when +instantiating ``ClientEncryption``, the instance +inherits the timeout setting from the ``MongoClient`` used in the +``ClientEncryption`` constructor. + +If you set ``timeoutMS`` both on the client and directly in +``ClientEncryption``, the value provided to ``ClientEncryption`` takes +precedence. + +.. _kotlin-csot-cursor: + +Cursors +------- + +Cursors offer configurable timeout settings when using the CSOT feature. You can +adjust cursor handling by configuring either the cursor lifetime or cursor +iteration mode. To configure the timeout mode, use the ``timeoutMode()`` +method when performing any operation that returns a result that inherits +``Flow``. + +For operations that create cursors, the timeout setting can either cap the +lifetime of the cursor or be applied separately to the original +operation and all subsequent calls. + +.. note:: Inherited Timeout + + Setting a cursor timeout mode requires that you set a timeout either + in the ``MongoClientSettings``, on ``MongoDatabase``, or on + ``MongoCollection``. + +To learn more about cursors and flows, see the +:ref:`kotlin-fundamentals-flow` guide. + +Cursor Lifetime Mode +~~~~~~~~~~~~~~~~~~~~ + +The cursor lifetime mode uses the timeout setting to limit the entire lifetime of a +cursor. In this mode, your application must initialize the cursor, complete +all calls to the cursor methods, and return all documents within the specified +time limit. Otherwise, the cursor's lifetime expires and the driver +raises a timeout error. + +When you close a cursor by calling the ``close()`` method, the +timeout resets for the ``killCursors`` command to ensure server-side resources are +cleaned up. + +The following example shows how to set a cursor timeout to ensure that +the cursor is initialized and all documents are retrieved within the +inherited timeout: + +.. literalinclude:: /examples/generated/CsotTest.snippet.cursor-lifetime.kt + :language: kotlin + :emphasize-lines: 3 + +API Documentation +----------------- + +To learn more about using timeouts with the {+driver-short+}, see the following +API documentation: + +- `MongoClientSettings <{+core-api+}/MongoClientSettings.html>`__ +- `MongoClientSettings.Builder.timeout() <{+core-api+}/MongoClientSettings.Builder.html#timeout(long,java.util.concurrent.TimeUnit)>`__ +- `MongoCollection.withTimeout() <{+driver-api+}/-mongo-collection/with-timeout.html>`__ +- `ClientSessionOptions.Builder.defaultTimeout() <{+core-api+}/ClientSessionOptions.Builder.html#defaultTimeout(long,java.util.concurrent.TimeUnit)>`__ +- `TransactionOptions.Builder.timeout() <{+core-api+}/TransactionOptions.Builder.html#timeout(java.lang.Long,java.util.concurrent.TimeUnit)>`__ +- `ClientEncryptionSettings.Builder.timeout() <{+core-api+}/ClientEncryptionSettings.Builder.html#timeout(long,java.util.concurrent.TimeUnit)>`__ +- `FindIterable.timeoutMode() <{+driver-api+}/-find-flow/index.html>`__ +- `TimeoutMode <{+core-api+}/client/cursor/TimeoutMode.html>`__ diff --git a/source/fundamentals/crud/read-operations/flow.txt b/source/fundamentals/crud/read-operations/flow.txt index 10c83762..fd3996b8 100644 --- a/source/fundamentals/crud/read-operations/flow.txt +++ b/source/fundamentals/crud/read-operations/flow.txt @@ -35,6 +35,12 @@ The ``find()`` method creates and returns an instance of a matched by your search criteria and to further specify which documents to see by setting parameters through methods. +.. tip:: Flow Timeout + + You can set a timeout on your flow to return query results. + To learn more, see the :ref:`kotlin-csot-cursor` section of the Limit + Server Execution Time guide. + Terminal Methods ---------------- diff --git a/source/fundamentals/transactions.txt b/source/fundamentals/transactions.txt index 62a89ea5..3988c3a2 100644 --- a/source/fundamentals/transactions.txt +++ b/source/fundamentals/transactions.txt @@ -81,6 +81,12 @@ following methods: error if there is no active transaction for the session or if the transaction was ended. +.. tip:: Transaction Timeout + + You can set a limit on amount of time that operations can take + to complete in your transactions. To learn more, see the + :ref:`kotlin-csot-transaction` section of the Limit Server Execution Time guide. + A ``ClientSession`` also has methods to retrieve session properties and modify mutable session properties. View the `API documentation <{+driver-api+}/-client-session/index.html>`__ to learn more about these methods. diff --git a/source/usage-examples/count.txt b/source/usage-examples/count.txt index 22b7f096..e93ecd9f 100644 --- a/source/usage-examples/count.txt +++ b/source/usage-examples/count.txt @@ -59,14 +59,18 @@ specify the behavior of the call: * - ``countDocuments()`` - ``CountOptions`` - - You can specify a maximum number of documents to count by using the - ``limit()`` method or the maximum amount of execution time using the - ``maxTime()`` method. + - You can set the following options: + + - ``collation()``: Sets the collation + - ``comment()``: Sets the comment + - ``hint()``: Sets the index to use + - ``hintString()``: Sets the index to use + - ``limit()``: Limits the documents to count + - ``skip()``: Skips the specified number of documents before counting * - ``estimatedDocumentCount()`` - ``EstimatedDocumentCountOptions`` - - You can specify the maximum execution time using the ``maxTime()`` - method. + - You can set a comment by using the ``comment()`` method. Both methods return the number of matching documents as a ``Long`` primitive. From 6b1b28b65bc236ba0262cc4fb6123eec92c9eedd Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 31 Mar 2025 14:45:53 -0400 Subject: [PATCH 04/13] whats new link (cherry picked from commit b94572d626ee297c7d253f33558adefaca06385c) --- source/whats-new.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/whats-new.txt b/source/whats-new.txt index 79ac2ec7..e65b3d3c 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -99,9 +99,7 @@ improvements, and fixes: .. replacement:: csot-link - the `MongoClientSettings.Builder.timeout() - <{+core-api+}/MongoClientSettings.Builder.html#timeout(long,java.util.concurrent.TimeUnit)>`__ - API documentation + the :ref:`kotlin-csot` guide .. replacement:: avs-index-link From 10ded253148c8ff1e533b1e4a4f12852f02376a3 Mon Sep 17 00:00:00 2001 From: rustagir Date: Mon, 31 Mar 2025 16:26:24 -0400 Subject: [PATCH 05/13] BOM (cherry picked from commit 31ef61283c580b8683568a4e515b436c475ec1b4) --- .../kotlin-driver-coroutine-gradle-versioned.rst | 2 +- .../kotlin-driver-coroutine-maven-versioned.rst | 1 - source/quick-start.txt | 15 +++++++++++++++ source/whats-new.txt | 4 ++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/source/includes/kotlin-driver-coroutine-gradle-versioned.rst b/source/includes/kotlin-driver-coroutine-gradle-versioned.rst index acab3236..3a6c8ca5 100644 --- a/source/includes/kotlin-driver-coroutine-gradle-versioned.rst +++ b/source/includes/kotlin-driver-coroutine-gradle-versioned.rst @@ -3,5 +3,5 @@ :copyable: true dependencies { - implementation("org.mongodb:mongodb-driver-kotlin-coroutine:{+full-version+}") + implementation("org.mongodb:mongodb-driver-kotlin-coroutine") } diff --git a/source/includes/kotlin-driver-coroutine-maven-versioned.rst b/source/includes/kotlin-driver-coroutine-maven-versioned.rst index 7a033704..ceaafb87 100644 --- a/source/includes/kotlin-driver-coroutine-maven-versioned.rst +++ b/source/includes/kotlin-driver-coroutine-maven-versioned.rst @@ -6,6 +6,5 @@ org.mongodb mongodb-driver-kotlin-coroutine - {+full-version+} diff --git a/source/quick-start.txt b/source/quick-start.txt index 1e5d8abf..d4bb58a0 100644 --- a/source/quick-start.txt +++ b/source/quick-start.txt @@ -66,6 +66,17 @@ or the `Building Maven `__ guide for more information on how to set up your project. +.. _kotlin-get-started-install-bom: + +Add the Driver Bill of Materials +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. sharedinclude:: dbx/jvm/bom.rst + + .. replacement:: gradle-filename + + ``build.gradle.kts`` + .. _add-mongodb-dependency: Add MongoDB as a Dependency @@ -82,6 +93,10 @@ packages, add the following entry to your ``pom.xml`` dependencies list: .. include:: /includes/kotlin-driver-coroutine-maven-versioned.rst +Because you installed the BOM, you can omit a version in the +{+driver-short+} dependency entry. The version you specify in the +BOM determines the dependency versions to install. + After you configure your dependencies, ensure that they are available to your project by running the dependency manager and refreshing the project in your IDE. diff --git a/source/whats-new.txt b/source/whats-new.txt index e65b3d3c..b4b3237f 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -33,6 +33,10 @@ and features: .. sharedinclude:: dbx/jvm/v5.4-wn-items.rst + .. replacement:: install-bom-link + + the :ref:`kotlin-get-started-install-bom` step of the Quick Start + .. replacement:: sort-option-link the :ref:`kotlin-client-bulk-write-update` and From b592d682f344f34c43116993b2938068535e2794 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 2 Apr 2025 12:37:38 -0400 Subject: [PATCH 06/13] [Kotlin CR] Add additional SearchOperator helper methods for the rest of the Atlas Search operators (#208) (#210) * atlas searchoperation helper methods * fix link * eg * ref link * WIP * moved the file to examples dir * WIP * WIP * WIP * WIP --------- Co-authored-by: rustagir Co-authored-by: Rea Rustagi <85902999+rustagir@users.noreply.github.com> (cherry picked from commit 05b26beab9a35a92d24588dec7e8d83670113866) Co-authored-by: Rachel Mackintosh <148898879+rachel-mack@users.noreply.github.com> --- .../src/test/kotlin/AggregatesBuilderTest.kt | 37 ++++- examples/src/test/kotlin/AggregationTest.kt | 126 +++++++++++++++--- ...ilderTest.snippet.atlas-search-pipeline.kt | 21 +++ ...tesBuilderTest.snippet.movie-data-class.kt | 3 +- ...gregationTest.snippet.basic-aggregation.kt | 6 +- ...egationTest.snippet.build-documents-tip.kt | 4 +- ...egationTest.snippet.explain-aggregation.kt | 2 +- source/fundamentals/aggregation.txt | 3 + source/fundamentals/builders/aggregates.txt | 25 ++++ source/whats-new.txt | 5 + 10 files changed, 208 insertions(+), 24 deletions(-) create mode 100644 source/examples/generated/AggregatesBuilderTest.snippet.atlas-search-pipeline.kt diff --git a/examples/src/test/kotlin/AggregatesBuilderTest.kt b/examples/src/test/kotlin/AggregatesBuilderTest.kt index b07258b2..94cabb6f 100644 --- a/examples/src/test/kotlin/AggregatesBuilderTest.kt +++ b/examples/src/test/kotlin/AggregatesBuilderTest.kt @@ -57,7 +57,8 @@ class AggregatesBuilderTest { val rated: String, val plot: String, val runtime: Int, - val imdb: IMDB + val imdb: IMDB, + val fullplot: String? = "No full plot", ){ data class IMDB( val rating: Double @@ -951,6 +952,40 @@ class AggregatesBuilderTest { assertEquals("Back to the Future", results.first().title) } + /* NOTE: Test is not run by default. FTS requires the creation of a text index on the collection before running + (see note at top of file for additional setup requirements for FTS). + */ + @Ignore + fun atlasSearchOperatorTest() = runBlocking { + + // :snippet-start: atlas-search-pipeline + data class Results(val title: String, val year: Int, val genres: List) + + val searchStage = Aggregates.search( + SearchOperator.compound() + .filter( + listOf( + SearchOperator.`in`(SearchPath.fieldPath(Movie::genres.name), listOf("Comedy")), + SearchOperator.phrase(SearchPath.fieldPath(Movie::fullplot.name), "new york"), + SearchOperator.numberRange(SearchPath.fieldPath(Movie::year.name)).gtLt(1950, 2000), + SearchOperator.wildcard(SearchPath.fieldPath(Movie::title.name), "Love *") + ) + ) + ) + + val projectStage = Aggregates.project( + Projections.include(Movie::title.name, Movie::year.name, Movie::genres.name)) + + val pipeline = listOf(searchStage, projectStage) + val resultsFlow = ftsCollection.aggregate(pipeline) + + resultsFlow.collect { println(it) } + // :snippet-end: + + val result = resultsFlow.toList() + assertEquals(2, result.size) + } + /* NOTE: Test is not run by default. FTS requires the creation of a text index on the collection before running (see note at top of file for additional setup requirements for FTS). */ diff --git a/examples/src/test/kotlin/AggregationTest.kt b/examples/src/test/kotlin/AggregationTest.kt index 3b7a54d9..7d366b26 100644 --- a/examples/src/test/kotlin/AggregationTest.kt +++ b/examples/src/test/kotlin/AggregationTest.kt @@ -4,17 +4,21 @@ import com.mongodb.client.model.Accumulators import com.mongodb.client.model.Aggregates import com.mongodb.client.model.Filters import com.mongodb.client.model.Projections +import com.mongodb.client.model.search.SearchOperator +import com.mongodb.client.model.search.SearchPath.fieldPath import com.mongodb.kotlin.client.coroutine.MongoClient import config.getConfig import kotlinx.coroutines.flow.toList import kotlinx.coroutines.runBlocking import org.bson.Document import org.bson.codecs.pojo.annotations.BsonId +import org.bson.conversions.Bson import org.bson.json.JsonWriterSettings import org.junit.jupiter.api.AfterAll import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.Test import kotlin.test.assertEquals +import kotlin.test.Ignore class AggregationTest { @@ -44,16 +48,102 @@ class AggregationTest { fun beforeAll() { runBlocking { val restaurants = listOf( - Restaurant("Sun Bakery Trattoria", Restaurant.Contact("386-555-0189", "SunBakeryTrattoria@example.org", listOf(-74.0056649, 40.7452371)), 4, listOf("Pizza", "Pasta", "Italian", "Coffee", "Sandwiches")), - Restaurant("Blue Bagels Grill", Restaurant.Contact("786-555-0102", "BlueBagelsGrill@example.com", listOf(-73.92506, 40.8275556)), 3, listOf("Bagels", "Cookies", "Sandwiches")), - Restaurant("XYZ Bagels Restaurant", Restaurant.Contact("435-555-0190", "XYZBagelsRestaurant@example.net", listOf(-74.0707363, 40.59321569999999)), 4, listOf("Bagels", "Sandwiches", "Coffee")), - Restaurant("Hot Bakery Cafe", Restaurant.Contact("264-555-0171", "HotBakeryCafe@example.net", listOf(-73.96485799999999, 40.761899)), 4, listOf("Bakery", "Cafe", "Coffee", "Dessert")), - Restaurant("Green Feast Pizzeria", Restaurant.Contact("840-555-0102", "GreenFeastPizzeria@example.com", listOf(-74.1220973, 40.6129407)), 2, listOf("Pizza", "Italian")), - Restaurant("ZZZ Pasta Buffet", Restaurant.Contact("769-555-0152", "ZZZPastaBuffet@example.com", listOf(-73.9446421, 40.7253944)), 0, listOf("Pasta", "Italian", "Buffet", "Cafeteria")), - Restaurant("XYZ Coffee Bar", Restaurant.Contact("644-555-0193", "XYZCoffeeBar@example.net", listOf(-74.0166091, 40.6284767)), 5, listOf("Coffee", "Cafe", "Bakery", "Chocolates")), - Restaurant("456 Steak Restaurant", Restaurant.Contact("990-555-0165", "456SteakRestaurant@example.com", listOf(-73.9365108, 40.8497077)), 0, listOf("Steak", "Seafood")), - Restaurant("456 Cookies Shop", Restaurant.Contact("604-555-0149", "456CookiesShop@example.org", listOf(-73.8850023, 40.7494272)), 4, listOf("Bakery", "Cookies", "Cake", "Coffee")), - Restaurant("XYZ Steak Buffet", Restaurant.Contact("229-555-0197", "XYZSteakBuffet@example.org", listOf(-73.9799932, 40.7660886)), 3, listOf("Steak", "Salad", "Chinese")) + Restaurant( + "Sun Bakery Trattoria", + Restaurant.Contact( + "386-555-0189", + "SunBakeryTrattoria@example.org", + listOf(-74.0056649, 40.7452371) + ), + 4, + listOf("Pizza", "Pasta", "Italian", "Coffee", "Sandwiches") + ), + Restaurant( + "Blue Bagels Grill", + Restaurant.Contact( + "786-555-0102", + "BlueBagelsGrill@example.com", + listOf(-73.92506, 40.8275556) + ), + 3, + listOf("Bagels", "Cookies", "Sandwiches") + ), + Restaurant( + "XYZ Bagels Restaurant", + Restaurant.Contact( + "435-555-0190", + "XYZBagelsRestaurant@example.net", + listOf(-74.0707363, 40.59321569999999) + ), + 4, + listOf("Bagels", "Sandwiches", "Coffee") + ), + Restaurant( + "Hot Bakery Cafe", + Restaurant.Contact( + "264-555-0171", + "HotBakeryCafe@example.net", + listOf(-73.96485799999999, 40.761899) + ), + 4, + listOf("Bakery", "Cafe", "Coffee", "Dessert") + ), + Restaurant( + "Green Feast Pizzeria", + Restaurant.Contact( + "840-555-0102", + "GreenFeastPizzeria@example.com", + listOf(-74.1220973, 40.6129407) + ), + 2, + listOf("Pizza", "Italian") + ), + Restaurant( + "ZZZ Pasta Buffet", + Restaurant.Contact( + "769-555-0152", + "ZZZPastaBuffet@example.com", + listOf(-73.9446421, 40.7253944) + ), + 0, + listOf("Pasta", "Italian", "Buffet", "Cafeteria") + ), + Restaurant( + "XYZ Coffee Bar", + Restaurant.Contact("644-555-0193", "XYZCoffeeBar@example.net", listOf(-74.0166091, 40.6284767)), + 5, + listOf("Coffee", "Cafe", "Bakery", "Chocolates") + ), + Restaurant( + "456 Steak Restaurant", + Restaurant.Contact( + "990-555-0165", + "456SteakRestaurant@example.com", + listOf(-73.9365108, 40.8497077) + ), + 0, + listOf("Steak", "Seafood") + ), + Restaurant( + "456 Cookies Shop", + Restaurant.Contact( + "604-555-0149", + "456CookiesShop@example.org", + listOf(-73.8850023, 40.7494272) + ), + 4, + listOf("Bakery", "Cookies", "Cake", "Coffee") + ), + Restaurant( + "XYZ Steak Buffet", + Restaurant.Contact( + "229-555-0197", + "XYZSteakBuffet@example.org", + listOf(-73.9799932, 40.7660886) + ), + 3, + listOf("Steak", "Salad", "Chinese") + ) ) collection.insertMany(restaurants) } @@ -71,15 +161,17 @@ class AggregationTest { } @Test - fun basicAggregationTest() = runBlocking { + fun basicAggregationTest() = runBlocking { // :snippet-start: basic-aggregation data class Results(@BsonId val id: Int, val count: Int) val resultsFlow = collection.aggregate( listOf( Aggregates.match(Filters.eq(Restaurant::categories.name, "Bakery")), - Aggregates.group("\$${Restaurant::stars.name}", - Accumulators.sum("count", 1)) + Aggregates.group( + "\$${Restaurant::stars.name}", + Accumulators.sum("count", 1) + ) ) ) @@ -124,7 +216,7 @@ class AggregationTest { @Test fun explainAggregationTest() = runBlocking { // :snippet-start: explain-aggregation - data class Results (val name: String, val count: Int) + data class Results(val name: String, val count: Int) val explanation = collection.aggregate( listOf( @@ -143,11 +235,11 @@ class AggregationTest { @Test fun buildDocumentsTipTest() { val method1 = - // :snippet-start: build-documents-tip - Document("\$arrayElemAt", listOf("\$categories", 0)) + // :snippet-start: build-documents-tip + Document("\$arrayElemAt", listOf("\$categories", 0)) // is equivalent to val method2 = // :remove: - Document.parse("{ \$arrayElemAt: ['\$categories', 0] }") + Document.parse("{ \$arrayElemAt: ['\$categories', 0] }") // :snippet-end: // assert to test equivalency assertEquals(method1, method2) diff --git a/source/examples/generated/AggregatesBuilderTest.snippet.atlas-search-pipeline.kt b/source/examples/generated/AggregatesBuilderTest.snippet.atlas-search-pipeline.kt new file mode 100644 index 00000000..9a9352f2 --- /dev/null +++ b/source/examples/generated/AggregatesBuilderTest.snippet.atlas-search-pipeline.kt @@ -0,0 +1,21 @@ +data class Results(val title: String, val year: Int, val genres: List) + +val searchStage = Aggregates.search( + SearchOperator.compound() + .filter( + listOf( + SearchOperator.`in`(SearchPath.fieldPath(Movie::genres.name), listOf("Comedy")), + SearchOperator.phrase(SearchPath.fieldPath(Movie::fullplot.name), "new york"), + SearchOperator.numberRange(SearchPath.fieldPath(Movie::year.name)).gtLt(1950, 2000), + SearchOperator.wildcard(SearchPath.fieldPath(Movie::title.name), "Love *") + ) + ) +) + +val projectStage = Aggregates.project( + Projections.include(Movie::title.name, Movie::year.name, Movie::genres.name)) + +val pipeline = listOf(searchStage, projectStage) +val resultsFlow = ftsCollection.aggregate(pipeline) + +resultsFlow.collect { println(it) } diff --git a/source/examples/generated/AggregatesBuilderTest.snippet.movie-data-class.kt b/source/examples/generated/AggregatesBuilderTest.snippet.movie-data-class.kt index dc131d0e..7bfc0f44 100644 --- a/source/examples/generated/AggregatesBuilderTest.snippet.movie-data-class.kt +++ b/source/examples/generated/AggregatesBuilderTest.snippet.movie-data-class.kt @@ -5,7 +5,8 @@ data class Movie( val rated: String, val plot: String, val runtime: Int, - val imdb: IMDB + val imdb: IMDB, + val fullplot: String? = "No full plot", ){ data class IMDB( val rating: Double diff --git a/source/examples/generated/AggregationTest.snippet.basic-aggregation.kt b/source/examples/generated/AggregationTest.snippet.basic-aggregation.kt index d3b7a52f..51f726de 100644 --- a/source/examples/generated/AggregationTest.snippet.basic-aggregation.kt +++ b/source/examples/generated/AggregationTest.snippet.basic-aggregation.kt @@ -3,8 +3,10 @@ data class Results(@BsonId val id: Int, val count: Int) val resultsFlow = collection.aggregate( listOf( Aggregates.match(Filters.eq(Restaurant::categories.name, "Bakery")), - Aggregates.group("\$${Restaurant::stars.name}", - Accumulators.sum("count", 1)) + Aggregates.group( + "\$${Restaurant::stars.name}", + Accumulators.sum("count", 1) + ) ) ) diff --git a/source/examples/generated/AggregationTest.snippet.build-documents-tip.kt b/source/examples/generated/AggregationTest.snippet.build-documents-tip.kt index bb27fa8a..21c72e26 100644 --- a/source/examples/generated/AggregationTest.snippet.build-documents-tip.kt +++ b/source/examples/generated/AggregationTest.snippet.build-documents-tip.kt @@ -1,3 +1,3 @@ -Document("\$arrayElemAt", listOf("\$categories", 0)) + Document("\$arrayElemAt", listOf("\$categories", 0)) // is equivalent to -Document.parse("{ \$arrayElemAt: ['\$categories', 0] }") + Document.parse("{ \$arrayElemAt: ['\$categories', 0] }") diff --git a/source/examples/generated/AggregationTest.snippet.explain-aggregation.kt b/source/examples/generated/AggregationTest.snippet.explain-aggregation.kt index 7efe45ee..6aaebceb 100644 --- a/source/examples/generated/AggregationTest.snippet.explain-aggregation.kt +++ b/source/examples/generated/AggregationTest.snippet.explain-aggregation.kt @@ -1,4 +1,4 @@ -data class Results (val name: String, val count: Int) +data class Results(val name: String, val count: Int) val explanation = collection.aggregate( listOf( diff --git a/source/fundamentals/aggregation.txt b/source/fundamentals/aggregation.txt index c3d5b45f..d3913e9a 100644 --- a/source/fundamentals/aggregation.txt +++ b/source/fundamentals/aggregation.txt @@ -215,6 +215,9 @@ first element in the ``categories`` field. Results(name=456 Cookies Shop, firstCategory=Bakery) Results(name=XYZ Steak Buffet, firstCategory=Steak) +API Documentation +----------------- + For more information about the methods and classes mentioned in this section, see the following API Documentation: diff --git a/source/fundamentals/builders/aggregates.txt b/source/fundamentals/builders/aggregates.txt index ca5d8913..1413b0bf 100644 --- a/source/fundamentals/builders/aggregates.txt +++ b/source/fundamentals/builders/aggregates.txt @@ -887,6 +887,31 @@ field in the ``movies`` collection for text that contains the word "Future": Learn more about the builders from the `search package API documentation <{+core-api+}/client/model/search/package-summary.html>`__. +.. _kotlin-cr-atlas-search-stage: + +Search Operator Methods +~~~~~~~~~~~~~~~~~~~~~~~ + +.. sharedinclude:: dbx/jvm/atlas-search-operator-helpers.rst + + .. replacement:: as-idx-link + + the :ref:`kotlin-search-indexes` section of the Indexes guide + + .. replacement:: atlas-query-operators-example + + .. io-code-block:: + + .. input:: /examples/generated/AggregatesBuilderTest.snippet.atlas-search-pipeline.kt + :language: kotlin + + .. output:: + :language: console + :visible: false + + Results(title=Love at First Bite, year=1979, genres=[Comedy, Romance]) + Results(title=Love Affair, year=1994, genres=[Comedy, Drama]) + Atlas Search Metadata --------------------- diff --git a/source/whats-new.txt b/source/whats-new.txt index b4b3237f..12874633 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -53,6 +53,11 @@ and features: the `SearchOperator <{+core-api+}/client/model/search/SearchOperator.html>`__ interface API documentation + .. replacement:: atlas-query-operators + + the :ref:`kotlin-cr-atlas-search-stage` section of the Aggregates + Builders guide + .. _kotlin-coroutine-version-5.3: What's New in 5.3 From 7e7e02a80f1bc6c9c1ed409217079524bf678396 Mon Sep 17 00:00:00 2001 From: Nick Larew Date: Fri, 11 Apr 2025 10:22:59 -0500 Subject: [PATCH 07/13] Add missing meta descriptions (#211) (cherry picked from commit dde0e16f7929ceffbf2bb8fec48bc25da7588672) --- source/api-documentation.txt | 3 +++ source/compatibility.txt | 3 +++ source/connection-troubleshooting.txt | 3 +++ source/faq.txt | 1 + source/fundamentals/aggregation-expression-operations.txt | 3 +++ source/fundamentals/aggregation.txt | 3 +++ source/fundamentals/auth.txt | 3 +++ source/fundamentals/builders.txt | 3 +++ source/fundamentals/collations.txt | 3 +++ source/fundamentals/connection.txt | 3 +++ source/fundamentals/crud.txt | 3 +++ source/fundamentals/data-formats.txt | 3 +++ source/fundamentals/databases-collections.txt | 3 +++ source/fundamentals/indexes.txt | 1 + source/fundamentals/logging.txt | 3 +++ source/fundamentals/monitoring.txt | 3 +++ source/fundamentals/stable-api.txt | 3 +++ source/fundamentals/time-series.txt | 3 +++ source/index.txt | 3 +++ source/issues-and-help.txt | 1 + source/quick-reference.txt | 3 +++ source/quick-start.txt | 1 + source/usage-examples.txt | 3 +++ source/whats-new.txt | 3 +++ 24 files changed, 64 insertions(+) diff --git a/source/api-documentation.txt b/source/api-documentation.txt index c0211098..07daf3bb 100644 --- a/source/api-documentation.txt +++ b/source/api-documentation.txt @@ -2,6 +2,9 @@ API Documentation ================= +.. meta:: + :description: Explore the API documentation for Kotlin, including BSON serialization, driver extensions, core functionality, and coroutine and sync drivers. + .. toctree:: :titlesonly: :maxdepth: 1 diff --git a/source/compatibility.txt b/source/compatibility.txt index b6ff89dc..08d68039 100644 --- a/source/compatibility.txt +++ b/source/compatibility.txt @@ -4,6 +4,9 @@ Compatibility ============= +.. meta:: + :description: Check the recommended versions of the MongoDB Kotlin Driver for compatibility with specific MongoDB and Kotlin versions. + .. contents:: On this page :local: :backlinks: none diff --git a/source/connection-troubleshooting.txt b/source/connection-troubleshooting.txt index 1d2d7e2b..a2ac88cd 100644 --- a/source/connection-troubleshooting.txt +++ b/source/connection-troubleshooting.txt @@ -4,6 +4,9 @@ Connection Troubleshooting ========================== +.. meta:: + :description: Troubleshoot connection issues with the MongoDB Kotlin Driver by checking connection strings, configuring firewalls, and verifying authentication settings. + .. contents:: On this page :local: :backlinks: none diff --git a/source/faq.txt b/source/faq.txt index 6443300f..7377479c 100644 --- a/source/faq.txt +++ b/source/faq.txt @@ -10,6 +10,7 @@ FAQ .. meta:: :keywords: troubleshooting, question, support + :description: Find answers to common questions about the Kotlin driver, including connection issues, differences from KMongo, and connection pooling. .. contents:: On this page :local: diff --git a/source/fundamentals/aggregation-expression-operations.txt b/source/fundamentals/aggregation-expression-operations.txt index c3e7c87f..253af6d2 100644 --- a/source/fundamentals/aggregation-expression-operations.txt +++ b/source/fundamentals/aggregation-expression-operations.txt @@ -4,6 +4,9 @@ Aggregation Expression Operations ================================= +.. meta:: + :description: Learn to use the MongoDB Kotlin Driver for constructing aggregation expressions with typesafe Java methods, enhancing readability and functionality. + .. contents:: On this page :local: :backlinks: none diff --git a/source/fundamentals/aggregation.txt b/source/fundamentals/aggregation.txt index d3913e9a..7111af22 100644 --- a/source/fundamentals/aggregation.txt +++ b/source/fundamentals/aggregation.txt @@ -4,6 +4,9 @@ Aggregation =========== +.. meta:: + :description: Learn to use aggregation operations in the MongoDB Kotlin driver to process data and return computed results using the aggregation pipeline. + .. contents:: On this page :local: :backlinks: none diff --git a/source/fundamentals/auth.txt b/source/fundamentals/auth.txt index 237805ef..a633e970 100644 --- a/source/fundamentals/auth.txt +++ b/source/fundamentals/auth.txt @@ -4,6 +4,9 @@ Authentication Mechanisms ========================= +.. meta:: + :description: Learn how to authenticate with MongoDB using various mechanisms like SCRAM-SHA-256, MONGODB-AWS, and X.509, and configure connections with Kotlin. + .. contents:: On this page :local: :backlinks: none diff --git a/source/fundamentals/builders.txt b/source/fundamentals/builders.txt index 254413a1..59ad31b8 100644 --- a/source/fundamentals/builders.txt +++ b/source/fundamentals/builders.txt @@ -4,6 +4,9 @@ Builders ======== +.. meta:: + :description: Explore how to use Kotlin driver builder classes for efficient CRUD operations and aggregation, enhancing error detection and code completion in your IDE. + .. toctree:: Aggregation diff --git a/source/fundamentals/collations.txt b/source/fundamentals/collations.txt index 8d3428b0..6d5b9746 100644 --- a/source/fundamentals/collations.txt +++ b/source/fundamentals/collations.txt @@ -2,6 +2,9 @@ Collations ========== +.. meta:: + :description: Learn how to use collations in MongoDB to order query results by string values, including specifying collations for collections, indexes, and operations. + .. contents:: On this page :local: :backlinks: none diff --git a/source/fundamentals/connection.txt b/source/fundamentals/connection.txt index db49932d..d35eb0c8 100644 --- a/source/fundamentals/connection.txt +++ b/source/fundamentals/connection.txt @@ -4,6 +4,9 @@ Connection Guide ================ +.. meta:: + :description: Explore how to set up and configure a connection to a MongoDB deployment using the Kotlin Coroutine driver, including options for network compression and TLS/SSL. + .. toctree:: Connect to MongoDB diff --git a/source/fundamentals/crud.txt b/source/fundamentals/crud.txt index ea152d08..49f18969 100644 --- a/source/fundamentals/crud.txt +++ b/source/fundamentals/crud.txt @@ -4,6 +4,9 @@ CRUD Operations =============== +.. meta:: + :description: Explore how to perform CRUD operations using Kotlin Coroutine with MongoDB, including creating, reading, updating, and deleting documents. + .. toctree:: :caption: CRUD Operations diff --git a/source/fundamentals/data-formats.txt b/source/fundamentals/data-formats.txt index 5737e098..b2996616 100644 --- a/source/fundamentals/data-formats.txt +++ b/source/fundamentals/data-formats.txt @@ -2,6 +2,9 @@ Data Formats ============ +.. meta:: + :description: Explore various data formats in Kotlin, including BSON, Extended JSON, and Kotlin Serialization, and learn about codecs and document data formats. + .. toctree:: :caption: Data Formats diff --git a/source/fundamentals/databases-collections.txt b/source/fundamentals/databases-collections.txt index 773288cf..26e52adf 100644 --- a/source/fundamentals/databases-collections.txt +++ b/source/fundamentals/databases-collections.txt @@ -2,6 +2,9 @@ Databases and Collections ========================= +.. meta:: + :description: Learn to use MongoDB databases and collections with the Kotlin driver, including accessing, creating, and managing collections and specifying read/write concerns. + .. contents:: On this page :local: :backlinks: none diff --git a/source/fundamentals/indexes.txt b/source/fundamentals/indexes.txt index 0084ea27..05928e1f 100644 --- a/source/fundamentals/indexes.txt +++ b/source/fundamentals/indexes.txt @@ -10,6 +10,7 @@ Indexes .. meta:: :keywords: code example, optimization, atlas search + :description: Learn to create and manage indexes using the MongoDB Kotlin Driver to optimize query performance and support various query types. .. contents:: On this page :local: diff --git a/source/fundamentals/logging.txt b/source/fundamentals/logging.txt index efbc4509..5cd074a8 100644 --- a/source/fundamentals/logging.txt +++ b/source/fundamentals/logging.txt @@ -4,6 +4,9 @@ Logging ======= +.. meta:: + :description: Learn how to set up and configure logging in the MongoDB Kotlin driver using SLF4J, including setting log levels and logger names. + .. contents:: On this page :local: :backlinks: none diff --git a/source/fundamentals/monitoring.txt b/source/fundamentals/monitoring.txt index 7c1de3e9..d9ce973b 100644 --- a/source/fundamentals/monitoring.txt +++ b/source/fundamentals/monitoring.txt @@ -2,6 +2,9 @@ Monitoring ========== +.. meta:: + :description: Learn how to set up and configure monitoring in the MongoDB Kotlin driver to track resource usage and performance. + .. contents:: On this page :local: :backlinks: none diff --git a/source/fundamentals/stable-api.txt b/source/fundamentals/stable-api.txt index 521df9a1..6f87eb21 100644 --- a/source/fundamentals/stable-api.txt +++ b/source/fundamentals/stable-api.txt @@ -5,6 +5,9 @@ {+stable-api+} ============== +.. meta:: + :description: Learn how to enable and configure the Stable API feature in MongoDB to ensure compatibility with specified API versions when connecting to a server. + .. contents:: On this page :local: :backlinks: none diff --git a/source/fundamentals/time-series.txt b/source/fundamentals/time-series.txt index 060e57a4..43122da0 100644 --- a/source/fundamentals/time-series.txt +++ b/source/fundamentals/time-series.txt @@ -2,6 +2,9 @@ Time Series Collections ======================= +.. meta:: + :description: Learn how to create and query time series collections using the MongoDB Kotlin driver, including setting up collection options and using window functions for data aggregation. + .. contents:: On this page :local: :backlinks: none diff --git a/source/index.txt b/source/index.txt index 5128b0dd..b2f74ecc 100644 --- a/source/index.txt +++ b/source/index.txt @@ -2,6 +2,9 @@ MongoDB Kotlin Driver ===================== +.. meta:: + :description: Explore the MongoDB Kotlin Driver for server-side applications using coroutines, including setup, usage examples, and troubleshooting. + .. toctree:: :titlesonly: :maxdepth: 1 diff --git a/source/issues-and-help.txt b/source/issues-and-help.txt index 9323000c..41af1d1c 100644 --- a/source/issues-and-help.txt +++ b/source/issues-and-help.txt @@ -10,6 +10,7 @@ Issues & Help .. meta:: :keywords: kotlin coroutine, troubleshooting, feedback + :description: Find support for the Kotlin driver through the MongoDB Community Forums, report issues via Jira, or contribute improvements with pull requests. .. contents:: On this page :local: diff --git a/source/quick-reference.txt b/source/quick-reference.txt index d65a6ab4..3b068d5b 100644 --- a/source/quick-reference.txt +++ b/source/quick-reference.txt @@ -4,6 +4,9 @@ Quick Reference =============== +.. meta:: + :description: Explore Kotlin Coroutine driver syntax for MongoDB commands, including find, insert, update, delete, and more, with examples and API documentation links. + This page shows the driver syntax for several MongoDB commands and links to their related reference and API documentation. diff --git a/source/quick-start.txt b/source/quick-start.txt index d4bb58a0..85dc96a0 100644 --- a/source/quick-start.txt +++ b/source/quick-start.txt @@ -10,6 +10,7 @@ Kotlin Driver Quick Start .. meta:: :keywords: code example, get started, runnable app + :description: Learn to connect a Kotlin application to a MongoDB Atlas cluster using the Kotlin driver, including setup, dependencies, and querying sample data. .. contents:: On this page :local: diff --git a/source/usage-examples.txt b/source/usage-examples.txt index 56cb08d2..70306df2 100644 --- a/source/usage-examples.txt +++ b/source/usage-examples.txt @@ -2,6 +2,9 @@ Usage Examples ============== +.. meta:: + :description: Explore Kotlin usage examples for popular MongoDB operations, including setup instructions and sample code for easy integration. + .. contents:: On this page :local: :backlinks: none diff --git a/source/whats-new.txt b/source/whats-new.txt index 12874633..dc4e2370 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -4,6 +4,9 @@ What's New ========== +.. meta:: + :description: Discover the latest features, improvements, and fixes in recent Kotlin driver versions, including new classes, API changes, and enhanced support for various MongoDB functionalities. + .. contents:: On this page :local: :backlinks: none From 8657a6abe4d1cad62c0afd745073ebf1bc871ae2 Mon Sep 17 00:00:00 2001 From: Rea Rustagi <85902999+rustagir@users.noreply.github.com> Date: Mon, 14 Apr 2025 11:00:16 -0400 Subject: [PATCH 08/13] DOCSP-48759: docker note (#212) (cherry picked from commit 2ddcc6dceec29cd4d3f50981055ff148f040a794) --- source/fundamentals/connection/connect.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/fundamentals/connection/connect.txt b/source/fundamentals/connection/connect.txt index 78754640..2506376e 100644 --- a/source/fundamentals/connection/connect.txt +++ b/source/fundamentals/connection/connect.txt @@ -177,3 +177,6 @@ class. Select the tab that corresponds to your preferred class. .. literalinclude:: /examples/generated/ConnectTest.snippet.connect-to-multiple-hosts-with-mongo-client-settings.kt :language: kotlin +.. note:: Replica Set in Docker + + .. sharedinclude:: dbx/docker-replica-set.rst From 5c65e8d2b9e914e827dbf5d54e82602130c20d2a Mon Sep 17 00:00:00 2001 From: Rea Rustagi <85902999+rustagir@users.noreply.github.com> Date: Tue, 22 Apr 2025 10:40:42 -0400 Subject: [PATCH 09/13] DOCSP-48679: strongly recommend Netty (#213) (cherry picked from commit 839b9e2e0d5e066120cd49f1424e1a29a9c98541) --- examples/src/test/kotlin/TlsTest.kt | 26 ++++++- snooty.toml | 2 +- ...TlsTest.snippet.netty-tls-configuration.kt | 10 +-- source/fundamentals/connection/tls.txt | 68 +++++++++++++++---- 4 files changed, 88 insertions(+), 18 deletions(-) diff --git a/examples/src/test/kotlin/TlsTest.kt b/examples/src/test/kotlin/TlsTest.kt index f4548316..aada1d67 100644 --- a/examples/src/test/kotlin/TlsTest.kt +++ b/examples/src/test/kotlin/TlsTest.kt @@ -1,6 +1,7 @@ - import com.mongodb.ConnectionString import com.mongodb.MongoClientSettings +import com.mongodb.connection.SslSettings +import com.mongodb.connection.TransportSettings import com.mongodb.kotlin.client.coroutine.MongoClient import config.getConfig import io.netty.handler.ssl.SslContextBuilder @@ -12,6 +13,7 @@ import org.junit.jupiter.api.TestInstance import javax.net.ssl.SSLContext import kotlin.test.assertEquals + // :replace-start: { // "terms": { // "CONNECTION_URI_PLACEHOLDER": "\"\"" @@ -67,6 +69,28 @@ internal class TlsTest { assertEquals(true, settings.sslSettings.isEnabled) } + @Test + fun nettyTlsConfigurationTest() = runBlocking { + // :snippet-start: netty-tls-configuration + val sslContext = SslContextBuilder.forClient() + .sslProvider(SslProvider.OPENSSL) + .build() + + val settings = MongoClientSettings.builder() + .applyToSslSettings { builder: SslSettings.Builder -> builder.enabled(true) } + .transportSettings( + TransportSettings.nettyBuilder() + .sslContext(sslContext) + .build() + ) + .build() + + val mongoClient = MongoClient.create(settings); + // :snippet-end: + mongoClient.close() + assertEquals(true, settings.sslSettings.isEnabled) + } + @Test fun customTlsConfigurationTest() = runBlocking { // :snippet-start: custom-tls-configuration diff --git a/snooty.toml b/snooty.toml index c117c58e..bb4f753e 100644 --- a/snooty.toml +++ b/snooty.toml @@ -32,10 +32,10 @@ core-api = "{+api-root+}/mongodb-driver-core/com/mongodb" driver-api = "{+api-root+}/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine" stable-api = "Stable API" mongocrypt-version = "{+full-version+}" -nettyVersion = "io.netty:netty-all:4.1.79.Final" snappyVersion = "org.xerial.snappy:snappy-java:1.1.8.4" zstdVersion = "com.github.luben:zstd-jni:1.5.5-2" logbackVersion = "1.2.11" log4j2Version = "2.17.1" serializationVersion = "1.6.0" kotlinx-dt-version = "0.6.1" +netty-version = "io.netty:netty-all:4.1.87.Final" diff --git a/source/examples/generated/TlsTest.snippet.netty-tls-configuration.kt b/source/examples/generated/TlsTest.snippet.netty-tls-configuration.kt index 002634ba..70591be0 100644 --- a/source/examples/generated/TlsTest.snippet.netty-tls-configuration.kt +++ b/source/examples/generated/TlsTest.snippet.netty-tls-configuration.kt @@ -1,12 +1,14 @@ val sslContext = SslContextBuilder.forClient() .sslProvider(SslProvider.OPENSSL) .build() + val settings = MongoClientSettings.builder() - .applyToSslSettings { builder -> builder.enabled(true) } - .streamFactoryFactory( - NettyStreamFactoryFactory.builder() + .applyToSslSettings { builder: SslSettings.Builder -> builder.enabled(true) } + .transportSettings( + TransportSettings.nettyBuilder() .sslContext(sslContext) .build() ) .build() -val mongoClient = MongoClient.create(settings) + +val mongoClient = MongoClient.create(settings); diff --git a/source/fundamentals/connection/tls.txt b/source/fundamentals/connection/tls.txt index 7821feb9..e450d0fc 100644 --- a/source/fundamentals/connection/tls.txt +++ b/source/fundamentals/connection/tls.txt @@ -20,20 +20,24 @@ Enable TLS/SSL on a Connection Overview -------- -In this guide, you can learn how to connect to MongoDB instances with the -`TLS/SSL `__ -security protocol using the underlying TLS/SSL support in the JDK. To -configure your connection to use TLS/SSL, enable the TLS/SSL settings in -either the `ConnectionString <{+core-api+}/ConnectionString.html>`__ -or `MongoClientSettings <{+core-api+}/MongoClientSettings.html>`__. +In this guide, you can learn how to use the **TLS protocol** to secure your +connection to a MongoDB deployment. TLS is a cryptographic protocol that +secures communication between your application and MongoDB. To configure +your connection to use TLS, enable the TLS option and provide your +certificates for validation when creating a client. -.. note:: Debugging TLS/SSL +By default, the driver supports TLS/SSL connections to MongoDB +servers using the underlying support for TLS/SSL provided by the JDK. +This can be changed either by using the `Netty API +`__ or the extensibility of the `Java SE +API `__. - If you experience trouble setting up your TLS/SSL connection, you can - use the ``-Djavax.net.debug=all`` system property to view more - log statements. See `the Oracle guide to debugging TLS/SSL connections - `__ - for more information. +.. tip:: Prefer Netty for Asynchronous Apps + + We recommend using Netty for asychronous applications because it supports + asynchronous I/O and handles high connection volumes effectively. To + learn about using Netty to configure your TLS settings, see the + :ref:`kotlin-tls-netty-sslContext` section of this guide. .. _tls-enable: @@ -82,6 +86,14 @@ using a method in the ``MongoClientSettings.Builder`` class. .. literalinclude:: /examples/generated/TlsTest.snippet.tls-mongoclient-settings.kt :language: kotlin +.. note:: Debugging TLS/SSL + + If you experience trouble setting up your TLS/SSL connection, you can + use the ``-Djavax.net.debug=all`` system property to view more + log statements. See `the Oracle guide to debugging TLS/SSL connections + `__ + for more information. + .. _tls_configure-certificates: Configure Certificates @@ -225,6 +237,38 @@ To restrict your application to use only the TLS 1.2 protocol, set the the TLS 1.2 protocol, upgrade to a later release to connect by using TLS 1.2. +.. _kotlin-tls-netty-sslContext: + +Configure TLS/SSL by Using Netty SslContext +------------------------------------------- + +Include the following import statements: + +.. code-block:: kotlin + :copyable: true + + import com.mongodb.MongoClientSettings + import com.mongodb.connection.SslSettings + import com.mongodb.connection.TransportSettings + import com.mongodb.kotlin.client.coroutine.MongoClient + import io.netty.handler.ssl.SslContextBuilder + import io.netty.handler.ssl.SslProvider + +.. note:: Netty Package Version + + The driver tests with Netty package version ``{+netty-version+}`` + +To instruct the driver to use +`io.netty.handler.ssl.SslContext `__, +configure `NettyTransportSettings <{+core-api+}/connection/NettyTransportSettings.html>`__ +when you define your ``MongoClientSettings``. + +Use ``MongoClientSettings.Builder.transportSettings()`` +and ``NettyTransportSettings.Builder.sslContext()`` to build your settings: + +.. literalinclude:: /examples/generated/TlsTest.snippet.netty-tls-configuration.kt + :language: kotlin + .. _tls-custom-sslContext: Customize TLS/SSL Configuration through the Java SE SSLContext From 575cb9397bafb67dc603580708da2ed7c5a2c599 Mon Sep 17 00:00:00 2001 From: Michael Morisi Date: Tue, 29 Apr 2025 12:30:59 -0400 Subject: [PATCH 10/13] DOCSP-48544: Add AWS Lambda link (#215) (cherry picked from commit e348e28a73644b13f989349d432f7b3a318f679c) --- source/fundamentals/connection.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/fundamentals/connection.txt b/source/fundamentals/connection.txt index d35eb0c8..aeb50360 100644 --- a/source/fundamentals/connection.txt +++ b/source/fundamentals/connection.txt @@ -16,6 +16,7 @@ Connection Guide Network Compression TLS/SSL SOCKS5 Proxy Connection + AWS Lambda .. contents:: On this page :local: @@ -37,6 +38,7 @@ sections: - :ref:`Enable Network Compression ` - :ref:`Enable TLS/SSL on a Connection ` - :ref:`Connect to MongoDB by Using a SOCKS5 Proxy ` +- `Manage Connections with AWS Lambda `__ For information about authenticating with a MongoDB instance, see :ref:`` and :ref:``. From 7998a5b5b128e00a8021c121f11a4e709e5ba7fd Mon Sep 17 00:00:00 2001 From: lindseymoore <71525840+lindseymoore@users.noreply.github.com> Date: Thu, 22 May 2025 22:26:49 -0400 Subject: [PATCH 11/13] DOCSP-50017 Remove EOL versions (#220) (#221) (#222) * DOCSP-50017 Remove EOL versions * auth * auth suggestion NR * NR comments * get rid of font on headings (cherry picked from commit 94fd075a3dc034aaa464b665aa89094fb23bf8e5) (cherry picked from commit 7046a65689f30a4b07a83014adc04acf0dfbe28b) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- source/fundamentals/auth.txt | 144 +++--------------- source/fundamentals/builders/aggregates.txt | 14 +- source/fundamentals/builders/projections.txt | 6 - .../connection/network-compression.txt | 6 +- .../crud/read-operations/sort.txt | 4 +- source/fundamentals/enterprise-auth.txt | 2 +- source/fundamentals/indexes.txt | 11 +- source/fundamentals/stable-api.txt | 7 - source/fundamentals/time-series.txt | 7 +- .../mongodb-compatibility-table-kotlin.rst | 15 -- source/usage-examples/bulkWrite.txt | 5 +- source/usage-examples/count.txt | 9 -- 12 files changed, 37 insertions(+), 193 deletions(-) diff --git a/source/fundamentals/auth.txt b/source/fundamentals/auth.txt index a633e970..44118f6d 100644 --- a/source/fundamentals/auth.txt +++ b/source/fundamentals/auth.txt @@ -26,10 +26,7 @@ confirm identity and establish trust to ensure security. The mechanisms that you can use with the latest version of MongoDB Community Edition are as follows: -* :ref:`Default ` * :ref:`SCRAM-SHA-256 ` -* :ref:`SCRAM-SHA-1 ` -* :ref:`MONGODB-CR ` * :ref:`MONGODB-AWS ` * :ref:`X.509 ` @@ -48,38 +45,31 @@ Mechanisms ---------- .. _default-auth-mechanism: +.. _scram-sha-256-auth-mechanism: -Default -~~~~~~~ - -The default authentication mechanism setting uses one of the following -authentication mechanisms depending on what your MongoDB server supports: - -#. ``SCRAM-SHA-256`` -#. ``SCRAM-SHA-1`` -#. ``MONGODB-CR`` +SCRAM-SHA-256 +~~~~~~~~~~~~~ -Server versions 3.6 and earlier use ``MONGODB-CR`` as the default -mechanism. Newer versions of the server use one of the mechanisms for -which they advertise support. +``SCRAM-SHA-256`` is a salted challenge-response authentication mechanism +(SCRAM) that uses your username and password, encrypted with the ``SHA-256`` +algorithm, to authenticate your user. This is the default authentication +mechanism. The following code snippets show how to specify the authentication mechanism, using the following placeholders: -* ``db_username`` - your MongoDB database username -* ``db_password`` - your MongoDB database user's password -* ``hostname`` - network address of your MongoDB server, accessible by your client -* ``port`` - port number of your MongoDB server +* ``db_username`` - your MongoDB database username. +* ``db_password`` - your MongoDB database user's password. +* ``hostname`` - network address of your MongoDB server, accessible by your client. +* ``port`` - port number of your MongoDB server. * ``authenticationDb`` - MongoDB database that contains your user's authentication data. If you omit this parameter, the driver uses the default value ``admin``. Select the :guilabel:`Connection String` or the :guilabel:`MongoCredential` -tab below for instructions and sample code for specifying this authentication +tab below for instructions and sample code to specify this default authentication mechanism: -.. _mongo-client-setting-with-mongo-credential-example: - .. tabs:: .. tab:: @@ -102,38 +92,10 @@ mechanism: .. literalinclude:: /examples/generated/AuthTest.snippet.default-mongo-cred.kt :language: kotlin -For more information on the challenge-response (CR) and salted -challenge-response authentication mechanisms (SCRAM) that MongoDB supports, -see the :manual:`SCRAM ` section of the Server manual. - -.. _scram-sha-256-auth-mechanism: - -``SCRAM-SHA-256`` -~~~~~~~~~~~~~~~~~ - -.. note:: - - ``SCRAM-SHA-256`` is the default authentication method for MongoDB starting - in MongoDB 4.0. - -``SCRAM-SHA-256`` is a salted challenge-response authentication mechanism -(SCRAM) that uses your username and password, encrypted with the ``SHA-256`` -algorithm, to authenticate your user. - -The following code snippets show how to specify the authentication mechanism, -using the following placeholders: - -* ``db_username`` - your MongoDB database username. -* ``db_password`` - your MongoDB database user's password. -* ``hostname`` - network address of your MongoDB server, accessible by your client. -* ``port`` - port number of your MongoDB server. -* ``authenticationDb`` - MongoDB database that contains your user's - authentication data. If you omit this parameter, the driver uses the - default value ``admin``. - -Select the :guilabel:`Connection String` or the :guilabel:`MongoCredential` -tab below for instructions and sample code for specifying this authentication -mechanism: +You can also explicitly specify the ``SCRAM-SHA-256`` authentication mechanism, +as shown in the following code snippets. Select the :guilabel:`Connection String` +or the :guilabel:`MongoCredential` tab below for instructions and sample code for +specifying this authentication mechanism: .. tabs:: @@ -159,76 +121,10 @@ mechanism: .. literalinclude:: /examples/generated/AuthTest.snippet.scram-sha-256-cred.kt :language: kotlin -.. _scram-sha-1-auth-mechanism: - -``SCRAM-SHA-1`` -~~~~~~~~~~~~~~~ - -.. note:: - ``SCRAM-SHA-1`` is the default authentication method for MongoDB versions - 3.0, 3.2, 3.4, and 3.6. - -``SCRAM-SHA-1`` is a salted challenge-response mechanism (SCRAM) that uses your -username and password, encrypted with the ``SHA-1`` algorithm, to authenticate -your user. - -The following code snippets show how to specify the authentication mechanism, -using the following placeholders: - -* ``db_username`` - your MongoDB database username. -* ``db_password`` - your MongoDB database user's password. -* ``hostname`` - network address of your MongoDB server, accessible by your client. -* ``port`` - port number of your MongoDB server. -* ``authenticationDb`` - MongoDB database that contains your user's - authentication data. If you omit this parameter, the driver uses the - default value ``admin``. - -Select the :guilabel:`Connection String` or the :guilabel:`MongoCredential` -tab below for instructions and sample code for specifying this authentication -mechanism: - -.. tabs:: - - .. tab:: - :tabid: Connection String - - To specify the ``SCRAM-SHA-1`` authentication mechanism using a - connection string, assign the ``authMechanism`` parameter the value - ``SCRAM-SHA-1`` in your connection string. Your code to instantiate - a ``MongoClient`` should resemble the following: - - .. literalinclude:: /examples/generated/AuthTest.snippet.scram-sha-1-string.kt - :language: kotlin - - .. tab:: - :tabid: MongoCredential - - To specify the default authentication mechanism using the - ``MongoCredential`` class, use the - `createScramSha1Credential() <{+core-api+}/MongoCredential.html#createScramSha1Credential(java.lang.String,java.lang.String,char[])>`__ - method. Your code to instantiate a ``MongoClient`` should resemble the following: - - .. literalinclude:: /examples/generated/AuthTest.snippet.scram-sha-1-cred.kt - :language: kotlin - -.. _mongodb-cr-auth-mechanism: - -``MONGODB-CR`` -~~~~~~~~~~~~~~ - -``MONGODB-CR`` is a challenge-response authentication mechanism that uses your -username and password to authenticate your user. This authentication -mechanism was deprecated starting in MongoDB 3.6 and is no longer -supported as of MongoDB 4.0. - -You cannot specify this method explicitly; refer to the fallback provided -by the :ref:`default authentication mechanism ` to -connect using ``MONGODB-CR``. - .. _mongodb-aws-auth-mechanism: -``MONGODB-AWS`` -~~~~~~~~~~~~~~~ +MONGODB-AWS +~~~~~~~~~~~ .. note:: @@ -451,8 +347,8 @@ method: .. _x509-auth-mechanism: -``X.509`` -~~~~~~~~~ +X.509 +~~~~~ The ``X.509`` authentication mechanism uses :wikipedia:`TLS ` with X.509 certificates to diff --git a/source/fundamentals/builders/aggregates.txt b/source/fundamentals/builders/aggregates.txt index 1413b0bf..1d03ef1b 100644 --- a/source/fundamentals/builders/aggregates.txt +++ b/source/fundamentals/builders/aggregates.txt @@ -870,11 +870,10 @@ Atlas Full-Text Search Use the ``search()`` method to create a :manual:`$search ` pipeline stage that specifies a full-text search of one or more fields. -.. tip:: Only Available on Atlas for MongoDB v4.2 and later +.. tip:: Only Available on Collections with an Atlas Search Index - This aggregation pipeline operator is only available for collections hosted - on :atlas:`MongoDB Atlas ` clusters running v4.2 or later that are - covered by an :atlas:`Atlas search index `. + This aggregation pipeline operator is only available for collections + with an :atlas:`Atlas search index `. Learn more about the required setup and the functionality of this operator from the :ref:`Atlas Search ` documentation. @@ -920,13 +919,6 @@ Use the ``searchMeta()`` method to create a pipeline stage which returns only the metadata part of the results from Atlas full-text search queries. -.. tip:: Only Available on Atlas for MongoDB v4.4.11 and later - - This aggregation pipeline operator is only available - on :atlas:`MongoDB Atlas ` clusters running v4.4.11 and later. For a - detailed list of version availability, see the MongoDB Atlas documentation - on :atlas:`$searchMeta `. - The following example shows the ``count`` metadata for an Atlas search aggregation stage: diff --git a/source/fundamentals/builders/projections.txt b/source/fundamentals/builders/projections.txt index 7c376749..058f5491 100644 --- a/source/fundamentals/builders/projections.txt +++ b/source/fundamentals/builders/projections.txt @@ -230,12 +230,6 @@ When you've specified matching criteria in the **query** portion of your operati variant to specify a :manual:`positional projection ` to include the first element of an array. Only documents that match the query filter will be retrieved. -.. important:: - - In MongoDB version 4.4 and earlier, the specified array field must appear in the query filter. Beginning in MongoDB 4.4, - you can use a positional project on an array field that does not appear in the query filter. - - The following example projects the first element of the ``temperatures`` array: .. io-code-block:: diff --git a/source/fundamentals/connection/network-compression.txt b/source/fundamentals/connection/network-compression.txt index c7e2544f..48a4112c 100644 --- a/source/fundamentals/connection/network-compression.txt +++ b/source/fundamentals/connection/network-compression.txt @@ -17,9 +17,9 @@ and your application. The driver supports the following algorithms: -1. `Snappy `__: available in MongoDB 3.4 and later. -#. `Zlib `__: available in MongoDB 3.6 and later. -#. `Zstandard `__: available in MongoDB 4.2 and later. +1. `Snappy `__ +#. `Zlib `__ +#. `Zstandard `__ The driver tests against the following versions of these libraries: diff --git a/source/fundamentals/crud/read-operations/sort.txt b/source/fundamentals/crud/read-operations/sort.txt index 9d31514b..f53d680e 100644 --- a/source/fundamentals/crud/read-operations/sort.txt +++ b/source/fundamentals/crud/read-operations/sort.txt @@ -320,9 +320,9 @@ The data is modeled with the following Kotlin data class: OrderScore(id=5, description=one large vanilla and chocolate cake, score=0.6) OrderScore(id=2, description=two medium vanilla birthday cakes, score=0.6) -.. note:: Text Search Behavior in MongoDB 4.4 or Later +.. note:: Text Search Behavior in MongoDB 6.0 or Later - The structure of text search has changed for MongoDB 4.4 or later. You no + The structure of text search has changed for MongoDB 6.0 or later. You no longer need to project ``Projections.metaTextScore()`` into your ``FindFlow`` instance in order to sort on the text score. In addition, the field name you specify in a ``$meta`` text score aggregation operation diff --git a/source/fundamentals/enterprise-auth.txt b/source/fundamentals/enterprise-auth.txt index c20fe099..a00eae9e 100644 --- a/source/fundamentals/enterprise-auth.txt +++ b/source/fundamentals/enterprise-auth.txt @@ -229,7 +229,7 @@ to improve performance. LDAP (PLAIN) ~~~~~~~~~~~~ -*Available in MongoDB Enterprise Edition 3.4 and later.* +*Available in MongoDB Enterprise Edition.* You can authenticate to a Lightweight Directory Access Protocol (LDAP) server using your directory server username and password. diff --git a/source/fundamentals/indexes.txt b/source/fundamentals/indexes.txt index 05928e1f..01ef2a5b 100644 --- a/source/fundamentals/indexes.txt +++ b/source/fundamentals/indexes.txt @@ -98,8 +98,8 @@ your application uses indexes: operation updates an indexed field, MongoDB updates the related index. Since MongoDB supports dynamic schemas, applications can query against fields whose names cannot be known in advance or -are arbitrary. MongoDB 4.2 introduced :manual:`wildcard indexes ` to help support these queries. -Wildcard indexes are not designed to replace workload-based index planning. +are arbitrary with :manual:`wildcard indexes `. Wildcard indexes are +not designed to replace workload-based index planning. For more information on designing your data model and choosing indexes appropriate for your application, see the MongoDB server documentation on :manual:`Indexing Strategies ` and @@ -453,9 +453,8 @@ created in the preceding code snippet: :language: kotlin MongoDB also supports ``2d`` indexes for calculating distances on a -Euclidean plane and for working with the "legacy coordinate pairs" -syntax used in MongoDB 2.2 and earlier. To learn more, see -:manual:`Geospatial Queries ` in the Server manual. +Euclidean plane. To learn more, see :manual:`Geospatial Queries ` +in the Server manual. Unique Indexes ~~~~~~~~~~~~~~ @@ -588,7 +587,7 @@ The following snippet removes the "title_text" index from the collection: Remove an Index Using a Wildcard Character ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Starting with MongoDB 4.2, you can drop all indexes by calling the +You can drop all indexes by calling the ``dropIndexes()`` method on your collection: .. literalinclude:: /examples/generated/IndexesTest.snippet.drop-all-indexes.kt diff --git a/source/fundamentals/stable-api.txt b/source/fundamentals/stable-api.txt index 6f87eb21..a3678e08 100644 --- a/source/fundamentals/stable-api.txt +++ b/source/fundamentals/stable-api.txt @@ -14,13 +14,6 @@ :depth: 1 :class: singlecol -.. note:: - - The {+stable-api+} feature requires MongoDB Server 5.0 or later. - - You should only use the {+stable-api+} feature if all the MongoDB - servers you are connecting to support this feature. - Overview -------- diff --git a/source/fundamentals/time-series.txt b/source/fundamentals/time-series.txt index 43122da0..d43b98f4 100644 --- a/source/fundamentals/time-series.txt +++ b/source/fundamentals/time-series.txt @@ -53,10 +53,6 @@ method: .. literalinclude:: /examples/generated/TimeSeriesTest.snippet.create-time-series-collection.kt :language: kotlin -.. important:: - - Versions prior to MongoDB 5.0 cannot create a time series collection. - To check if you successfully created the collection, send the ``"listCollections"`` command to the `runCommand() <{+driver-api+}/-mongo-database/run-command.html>`__ method. @@ -93,8 +89,7 @@ and :ref:`aggregating data `. .. note:: Window Functions - MongoDB version 5.0 introduces window functions into the aggregation - pipeline. You can use window functions to perform operations on a + You can use window functions to perform operations on a contiguous span of time series data. For more information, see our diff --git a/source/includes/mongodb-compatibility-table-kotlin.rst b/source/includes/mongodb-compatibility-table-kotlin.rst index 3b493f40..77435695 100644 --- a/source/includes/mongodb-compatibility-table-kotlin.rst +++ b/source/includes/mongodb-compatibility-table-kotlin.rst @@ -7,28 +7,13 @@ - MongoDB 8.0 - MongoDB 7.0 - MongoDB 6.0 - - MongoDB 5.0 - - MongoDB 4.4 - - MongoDB 4.2 - - MongoDB 4.0 - - MongoDB 3.6 * - 5.2 to 5.4 - ✓ - ✓ - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - * - 4.10 to 5.1 - ⊛ - ✓ - ✓ - - ✓ - - ✓ - - ✓ - - ✓ - - ✓ diff --git a/source/usage-examples/bulkWrite.txt b/source/usage-examples/bulkWrite.txt index 74057073..6d17bf8c 100644 --- a/source/usage-examples/bulkWrite.txt +++ b/source/usage-examples/bulkWrite.txt @@ -34,9 +34,8 @@ The ``bulkWrite()`` method accepts the following parameters: .. note:: - Retryable writes run on MongoDB server versions 3.6 or later in bulk - write operations unless they include one or more instances of - ``UpdateManyModel`` or ``DeleteManyModel``. + Retryable writes run in bulk write operations unless they include one or + more instances of ``UpdateManyModel`` or ``DeleteManyModel``. .. tip:: diff --git a/source/usage-examples/count.txt b/source/usage-examples/count.txt index e93ecd9f..3433a9a6 100644 --- a/source/usage-examples/count.txt +++ b/source/usage-examples/count.txt @@ -36,15 +36,6 @@ When you call the ``countDocuments()`` method, you can optionally pass a **query filter** parameter. You cannot pass any parameters when you call ``estimatedDocumentCount()``. -.. important:: Stable API V1 and MongoDB Server Issue - - If you are using the Stable API ``V1`` with the "strict" option and a - MongoDB server version between 5.0.0 and 5.0.8 inclusive, method calls to - ``estimatedDocumentCount()`` may error due to a server bug. - - Upgrade to MongoDB server 5.0.9 or set the Stable API "strict" option to - ``false`` to avoid this issue. - You can also pass an optional parameter to either of these methods to specify the behavior of the call: From 0d65abb6586df2fd3dcc08acd32a82fd1f806e51 Mon Sep 17 00:00:00 2001 From: mballard-mdb Date: Fri, 6 Jun 2025 11:01:35 -0400 Subject: [PATCH 12/13] Docsp-49013 (#226) (#230) * DOCSP-49013: Added tips to redirect to installation to use BOM for better version management where kotlin extensions used in java/kotlin docs. * DOCSP-49013: Added tips to redirect to installation to use BOM for better version management where kotlin extensions used in java/kotlin docs. * DOCSP-49013: Fixing link. * DOCSP-49013: Includes attempt, link still broken * DOCSP-49013-Relocating BOM Tip on Serialization page * DOCSP-49013-fixing link * DOCSP-49013-fixing serialization * DOCSP-49013-actual installation page for link * DOCSP-49013-reverted link * DOCSP-49013-shared update * DOCSP-49013-update shared file name * DOCSP-49013-edits, removed versions from implementations and maven instr, better clarity in link wording * DOCSP-49013-whitespace, fix link * DOCSP-49013-fix removal of versions on dependencies * DOCSP-49013-shared include link fix? * DOCSP-49013-fix grammar on link * DOCSP-49013-fix grammar on link * DOCSP-49013-removed versions from mongodb-crypt and all kotlin(x) implementations managed by BOM * DOCSP-49013-encrypt fields update position of tio * DOCSP-49013-suggested changes * DOCSP-49013-encryption reformat * DOCSP-49013-indentation (cherry picked from commit 10143aa924e8ed127962c47d86070d2669793cf0) --- .../builders/builders-data-classes.txt | 9 +++- .../document-data-format-bson.txt | 6 +++ .../data-formats/serialization.txt | 12 +++-- source/fundamentals/encrypt-fields.txt | 51 +++++++++++-------- .../code-snippets/bson-gradle-versioned.rst | 2 +- .../code-snippets/bson-maven-versioned.rst | 1 - .../code-snippets/crypt-gradle-versioned.rst | 2 +- .../code-snippets/crypt-maven-versioned.rst | 1 - .../serialization-libs-gradle-versioned.rst | 4 +- .../serialization-libs-maven-versioned.rst | 2 - 10 files changed, 54 insertions(+), 36 deletions(-) diff --git a/source/fundamentals/builders/builders-data-classes.txt b/source/fundamentals/builders/builders-data-classes.txt index 7439c186..957a5f9c 100644 --- a/source/fundamentals/builders/builders-data-classes.txt +++ b/source/fundamentals/builders/builders-data-classes.txt @@ -49,6 +49,12 @@ To implement this functionality, you must add the ``mongodb-driver-kotlin-extensions`` dependency to your dependencies list. +.. sharedinclude:: dbx/jvm/BOM-installation-tip.rst + + .. replacement:: installation-guide + + :ref:`Add the Driver Bill of Materials ` step of the Quick Start guide. + Select from the following tabs to see how to add the extension dependency to your project by using the :guilabel:`Gradle` and :guilabel:`Maven` package managers: @@ -64,7 +70,7 @@ dependency to your project by using the :guilabel:`Gradle` and .. code-block:: kotlin :caption: build.gradle.kts - implementation("org.mongodb:mongodb-driver-kotlin-extensions:{+full-version+}") + implementation("org.mongodb:mongodb-driver-kotlin-extensions") .. tab:: :tabid: Maven @@ -78,7 +84,6 @@ dependency to your project by using the :guilabel:`Gradle` and org.mongodb mongodb-driver-kotlin-extensions - {+full-version+} After you install the extensions dependency, you can use the extension diff --git a/source/fundamentals/data-formats/document-data-format-bson.txt b/source/fundamentals/data-formats/document-data-format-bson.txt index ccaf0a6a..0612cd0b 100644 --- a/source/fundamentals/data-formats/document-data-format-bson.txt +++ b/source/fundamentals/data-formats/document-data-format-bson.txt @@ -60,6 +60,12 @@ MongoDB Kotlin driver as a dependency to your project, see the :ref:`driver installation ` section of our Quick Start guide. +.. sharedinclude:: dbx/jvm/BOM-installation-tip.rst + + .. replacement:: installation-guide + + :ref:`Add the Driver Bill of Materials ` step of the Quick Start guide. + We recommend that you use the `Maven `__ or `Gradle `__ build automation tool to manage your project's dependencies. Select from the following tabs to see the dependency declaration diff --git a/source/fundamentals/data-formats/serialization.txt b/source/fundamentals/data-formats/serialization.txt index 0a95e955..aeb1f964 100644 --- a/source/fundamentals/data-formats/serialization.txt +++ b/source/fundamentals/data-formats/serialization.txt @@ -60,6 +60,12 @@ Add {+language+} Serialization to Your Project Support for serialization in the {+driver-short+} depends on the official `Kotlin serialization library `__. +.. sharedinclude:: dbx/jvm/BOM-installation-tip.rst + + .. replacement:: installation-guide + + :ref:`Add the Driver Bill of Materials ` step of the Quick Start guide. + Select from the following tabs to see how to add the serialization dependencies to your project by using the :guilabel:`Gradle` and :guilabel:`Maven` package managers: @@ -76,7 +82,7 @@ dependencies to your project by using the :guilabel:`Gradle` and :caption: build.gradle.kts implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:{+serializationVersion+}") - implementation("org.mongodb:bson-kotlinx:{+full-version+}") + implementation("org.mongodb:bson-kotlinx") .. tab:: :tabid: Maven @@ -95,7 +101,6 @@ dependencies to your project by using the :guilabel:`Gradle` and org.mongodb bson-kotlinx - {+full-version+} .. _kotlin-data-class-annotation: @@ -191,7 +196,7 @@ add the dependency to your project by using the :guilabel:`Gradle` and .. code-block:: kotlin :caption: build.gradle.kts - implementation("org.mongodb:bson-kotlinx:{+full-version+}") + implementation("org.mongodb:bson-kotlinx") .. tab:: :tabid: Maven @@ -205,7 +210,6 @@ add the dependency to your project by using the :guilabel:`Gradle` and org.jetbrains.kotlinx bson-kotlinx - {+full-version+} .. note:: bson-kotlin Dependency diff --git a/source/fundamentals/encrypt-fields.txt b/source/fundamentals/encrypt-fields.txt index 0fa23918..884fed0c 100644 --- a/source/fundamentals/encrypt-fields.txt +++ b/source/fundamentals/encrypt-fields.txt @@ -4,25 +4,32 @@ .. replacement:: driver-specific-content - .. important:: Compatible Encryption Library Version - - The {+driver-short+} uses the `mongodb-crypt - `__ - encryption library for in-use encryption. This driver version - is compatible with ``mongodb-crypt`` v{+mongocrypt-version+}. - - Select from the following :guilabel:`Maven` and - :guilabel:`Gradle` tabs to see how to add the ``mongodb-crypt`` - dependency to your project by using the specified manager: - - .. tabs:: - - .. tab:: Maven - :tabid: maven-dependency - - .. include:: /includes/fundamentals/code-snippets/crypt-maven-versioned.rst - - .. tab:: Gradle - :tabid: gradle-dependency - - .. include:: /includes/fundamentals/code-snippets/crypt-gradle-versioned.rst + Compatible Encryption Library Version + ------------------------------------- + + The {+driver-short+} uses the `mongodb-crypt + `__ + encryption library for in-use encryption. This driver version + is compatible with ``mongodb-crypt`` v{+mongocrypt-version+}. + + .. sharedinclude:: dbx/jvm/BOM-installation-tip.rst + + .. replacement:: installation-guide + + :ref:`Add the Driver Bill of Materials ` step of the Quick Start guide. + + Select from the following :guilabel:`Maven` and + :guilabel:`Gradle` tabs to see how to add the ``mongodb-crypt`` + dependency to your project by using the specified manager: + + .. tabs:: + + .. tab:: Maven + :tabid: maven-dependency + + .. include:: /includes/fundamentals/code-snippets/crypt-maven-versioned.rst + + .. tab:: Gradle + :tabid: gradle-dependency + + .. include:: /includes/fundamentals/code-snippets/crypt-gradle-versioned.rst diff --git a/source/includes/fundamentals/code-snippets/bson-gradle-versioned.rst b/source/includes/fundamentals/code-snippets/bson-gradle-versioned.rst index c830af9b..d71aed34 100644 --- a/source/includes/fundamentals/code-snippets/bson-gradle-versioned.rst +++ b/source/includes/fundamentals/code-snippets/bson-gradle-versioned.rst @@ -1,6 +1,6 @@ .. code-block:: kotlin dependencies { - implementation("org.mongodb:bson:{+full-version+}") + implementation("org.mongodb:bson") } diff --git a/source/includes/fundamentals/code-snippets/bson-maven-versioned.rst b/source/includes/fundamentals/code-snippets/bson-maven-versioned.rst index 31e1dd6a..665cc6f1 100644 --- a/source/includes/fundamentals/code-snippets/bson-maven-versioned.rst +++ b/source/includes/fundamentals/code-snippets/bson-maven-versioned.rst @@ -4,7 +4,6 @@ org.mongodb bson - {+full-version+} diff --git a/source/includes/fundamentals/code-snippets/crypt-gradle-versioned.rst b/source/includes/fundamentals/code-snippets/crypt-gradle-versioned.rst index af6427b6..f5284de2 100644 --- a/source/includes/fundamentals/code-snippets/crypt-gradle-versioned.rst +++ b/source/includes/fundamentals/code-snippets/crypt-gradle-versioned.rst @@ -1,5 +1,5 @@ .. code-block:: groovy dependencies { - implementation("org.mongodb:mongodb-crypt:{+mongocrypt-version+}") + implementation("org.mongodb:mongodb-crypt") } \ No newline at end of file diff --git a/source/includes/fundamentals/code-snippets/crypt-maven-versioned.rst b/source/includes/fundamentals/code-snippets/crypt-maven-versioned.rst index 0b2c3b0e..db9fa409 100644 --- a/source/includes/fundamentals/code-snippets/crypt-maven-versioned.rst +++ b/source/includes/fundamentals/code-snippets/crypt-maven-versioned.rst @@ -4,6 +4,5 @@ org.mongodb mongodb-crypt - {+mongocrypt-version+} diff --git a/source/includes/serialization-libs-gradle-versioned.rst b/source/includes/serialization-libs-gradle-versioned.rst index ac994c76..971caa33 100644 --- a/source/includes/serialization-libs-gradle-versioned.rst +++ b/source/includes/serialization-libs-gradle-versioned.rst @@ -2,7 +2,7 @@ :caption: build.gradle.kts :copyable: true - implementation("org.mongodb:bson-kotlinx:{+full-version+}") + implementation("org.mongodb:bson-kotlinx") // OR - implementation("org.mongodb:bson-kotlin:{+full-version+}") + implementation("org.mongodb:bson-kotlin") \ No newline at end of file diff --git a/source/includes/serialization-libs-maven-versioned.rst b/source/includes/serialization-libs-maven-versioned.rst index 16ba6eb6..9fb8d6ee 100644 --- a/source/includes/serialization-libs-maven-versioned.rst +++ b/source/includes/serialization-libs-maven-versioned.rst @@ -5,12 +5,10 @@ org.mongodb bson-kotlinx - {+full-version+} org.mongodb bson-kotlin - {+full-version+} \ No newline at end of file From 05c4e2620b065477350aa4c6d5cb552a45f237fb Mon Sep 17 00:00:00 2001 From: Melanie Ballard Date: Mon, 9 Jun 2025 11:55:01 -0400 Subject: [PATCH 13/13] Revert "Docsp-49013 (#226) (#230)" This reverts commit 0d65abb6586df2fd3dcc08acd32a82fd1f806e51. --- .../builders/builders-data-classes.txt | 9 +--- .../document-data-format-bson.txt | 6 --- .../data-formats/serialization.txt | 12 ++--- source/fundamentals/encrypt-fields.txt | 51 ++++++++----------- .../code-snippets/bson-gradle-versioned.rst | 2 +- .../code-snippets/bson-maven-versioned.rst | 1 + .../code-snippets/crypt-gradle-versioned.rst | 2 +- .../code-snippets/crypt-maven-versioned.rst | 1 + .../serialization-libs-gradle-versioned.rst | 4 +- .../serialization-libs-maven-versioned.rst | 2 + 10 files changed, 36 insertions(+), 54 deletions(-) diff --git a/source/fundamentals/builders/builders-data-classes.txt b/source/fundamentals/builders/builders-data-classes.txt index 957a5f9c..7439c186 100644 --- a/source/fundamentals/builders/builders-data-classes.txt +++ b/source/fundamentals/builders/builders-data-classes.txt @@ -49,12 +49,6 @@ To implement this functionality, you must add the ``mongodb-driver-kotlin-extensions`` dependency to your dependencies list. -.. sharedinclude:: dbx/jvm/BOM-installation-tip.rst - - .. replacement:: installation-guide - - :ref:`Add the Driver Bill of Materials ` step of the Quick Start guide. - Select from the following tabs to see how to add the extension dependency to your project by using the :guilabel:`Gradle` and :guilabel:`Maven` package managers: @@ -70,7 +64,7 @@ dependency to your project by using the :guilabel:`Gradle` and .. code-block:: kotlin :caption: build.gradle.kts - implementation("org.mongodb:mongodb-driver-kotlin-extensions") + implementation("org.mongodb:mongodb-driver-kotlin-extensions:{+full-version+}") .. tab:: :tabid: Maven @@ -84,6 +78,7 @@ dependency to your project by using the :guilabel:`Gradle` and org.mongodb mongodb-driver-kotlin-extensions + {+full-version+} After you install the extensions dependency, you can use the extension diff --git a/source/fundamentals/data-formats/document-data-format-bson.txt b/source/fundamentals/data-formats/document-data-format-bson.txt index 0612cd0b..ccaf0a6a 100644 --- a/source/fundamentals/data-formats/document-data-format-bson.txt +++ b/source/fundamentals/data-formats/document-data-format-bson.txt @@ -60,12 +60,6 @@ MongoDB Kotlin driver as a dependency to your project, see the :ref:`driver installation ` section of our Quick Start guide. -.. sharedinclude:: dbx/jvm/BOM-installation-tip.rst - - .. replacement:: installation-guide - - :ref:`Add the Driver Bill of Materials ` step of the Quick Start guide. - We recommend that you use the `Maven `__ or `Gradle `__ build automation tool to manage your project's dependencies. Select from the following tabs to see the dependency declaration diff --git a/source/fundamentals/data-formats/serialization.txt b/source/fundamentals/data-formats/serialization.txt index aeb1f964..0a95e955 100644 --- a/source/fundamentals/data-formats/serialization.txt +++ b/source/fundamentals/data-formats/serialization.txt @@ -60,12 +60,6 @@ Add {+language+} Serialization to Your Project Support for serialization in the {+driver-short+} depends on the official `Kotlin serialization library `__. -.. sharedinclude:: dbx/jvm/BOM-installation-tip.rst - - .. replacement:: installation-guide - - :ref:`Add the Driver Bill of Materials ` step of the Quick Start guide. - Select from the following tabs to see how to add the serialization dependencies to your project by using the :guilabel:`Gradle` and :guilabel:`Maven` package managers: @@ -82,7 +76,7 @@ dependencies to your project by using the :guilabel:`Gradle` and :caption: build.gradle.kts implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:{+serializationVersion+}") - implementation("org.mongodb:bson-kotlinx") + implementation("org.mongodb:bson-kotlinx:{+full-version+}") .. tab:: :tabid: Maven @@ -101,6 +95,7 @@ dependencies to your project by using the :guilabel:`Gradle` and org.mongodb bson-kotlinx + {+full-version+} .. _kotlin-data-class-annotation: @@ -196,7 +191,7 @@ add the dependency to your project by using the :guilabel:`Gradle` and .. code-block:: kotlin :caption: build.gradle.kts - implementation("org.mongodb:bson-kotlinx") + implementation("org.mongodb:bson-kotlinx:{+full-version+}") .. tab:: :tabid: Maven @@ -210,6 +205,7 @@ add the dependency to your project by using the :guilabel:`Gradle` and org.jetbrains.kotlinx bson-kotlinx + {+full-version+} .. note:: bson-kotlin Dependency diff --git a/source/fundamentals/encrypt-fields.txt b/source/fundamentals/encrypt-fields.txt index 884fed0c..0fa23918 100644 --- a/source/fundamentals/encrypt-fields.txt +++ b/source/fundamentals/encrypt-fields.txt @@ -4,32 +4,25 @@ .. replacement:: driver-specific-content - Compatible Encryption Library Version - ------------------------------------- - - The {+driver-short+} uses the `mongodb-crypt - `__ - encryption library for in-use encryption. This driver version - is compatible with ``mongodb-crypt`` v{+mongocrypt-version+}. - - .. sharedinclude:: dbx/jvm/BOM-installation-tip.rst - - .. replacement:: installation-guide - - :ref:`Add the Driver Bill of Materials ` step of the Quick Start guide. - - Select from the following :guilabel:`Maven` and - :guilabel:`Gradle` tabs to see how to add the ``mongodb-crypt`` - dependency to your project by using the specified manager: - - .. tabs:: - - .. tab:: Maven - :tabid: maven-dependency - - .. include:: /includes/fundamentals/code-snippets/crypt-maven-versioned.rst - - .. tab:: Gradle - :tabid: gradle-dependency - - .. include:: /includes/fundamentals/code-snippets/crypt-gradle-versioned.rst + .. important:: Compatible Encryption Library Version + + The {+driver-short+} uses the `mongodb-crypt + `__ + encryption library for in-use encryption. This driver version + is compatible with ``mongodb-crypt`` v{+mongocrypt-version+}. + + Select from the following :guilabel:`Maven` and + :guilabel:`Gradle` tabs to see how to add the ``mongodb-crypt`` + dependency to your project by using the specified manager: + + .. tabs:: + + .. tab:: Maven + :tabid: maven-dependency + + .. include:: /includes/fundamentals/code-snippets/crypt-maven-versioned.rst + + .. tab:: Gradle + :tabid: gradle-dependency + + .. include:: /includes/fundamentals/code-snippets/crypt-gradle-versioned.rst diff --git a/source/includes/fundamentals/code-snippets/bson-gradle-versioned.rst b/source/includes/fundamentals/code-snippets/bson-gradle-versioned.rst index d71aed34..c830af9b 100644 --- a/source/includes/fundamentals/code-snippets/bson-gradle-versioned.rst +++ b/source/includes/fundamentals/code-snippets/bson-gradle-versioned.rst @@ -1,6 +1,6 @@ .. code-block:: kotlin dependencies { - implementation("org.mongodb:bson") + implementation("org.mongodb:bson:{+full-version+}") } diff --git a/source/includes/fundamentals/code-snippets/bson-maven-versioned.rst b/source/includes/fundamentals/code-snippets/bson-maven-versioned.rst index 665cc6f1..31e1dd6a 100644 --- a/source/includes/fundamentals/code-snippets/bson-maven-versioned.rst +++ b/source/includes/fundamentals/code-snippets/bson-maven-versioned.rst @@ -4,6 +4,7 @@ org.mongodb bson + {+full-version+} diff --git a/source/includes/fundamentals/code-snippets/crypt-gradle-versioned.rst b/source/includes/fundamentals/code-snippets/crypt-gradle-versioned.rst index f5284de2..af6427b6 100644 --- a/source/includes/fundamentals/code-snippets/crypt-gradle-versioned.rst +++ b/source/includes/fundamentals/code-snippets/crypt-gradle-versioned.rst @@ -1,5 +1,5 @@ .. code-block:: groovy dependencies { - implementation("org.mongodb:mongodb-crypt") + implementation("org.mongodb:mongodb-crypt:{+mongocrypt-version+}") } \ No newline at end of file diff --git a/source/includes/fundamentals/code-snippets/crypt-maven-versioned.rst b/source/includes/fundamentals/code-snippets/crypt-maven-versioned.rst index db9fa409..0b2c3b0e 100644 --- a/source/includes/fundamentals/code-snippets/crypt-maven-versioned.rst +++ b/source/includes/fundamentals/code-snippets/crypt-maven-versioned.rst @@ -4,5 +4,6 @@ org.mongodb mongodb-crypt + {+mongocrypt-version+} diff --git a/source/includes/serialization-libs-gradle-versioned.rst b/source/includes/serialization-libs-gradle-versioned.rst index 971caa33..ac994c76 100644 --- a/source/includes/serialization-libs-gradle-versioned.rst +++ b/source/includes/serialization-libs-gradle-versioned.rst @@ -2,7 +2,7 @@ :caption: build.gradle.kts :copyable: true - implementation("org.mongodb:bson-kotlinx") + implementation("org.mongodb:bson-kotlinx:{+full-version+}") // OR - implementation("org.mongodb:bson-kotlin") + implementation("org.mongodb:bson-kotlin:{+full-version+}") \ No newline at end of file diff --git a/source/includes/serialization-libs-maven-versioned.rst b/source/includes/serialization-libs-maven-versioned.rst index 9fb8d6ee..16ba6eb6 100644 --- a/source/includes/serialization-libs-maven-versioned.rst +++ b/source/includes/serialization-libs-maven-versioned.rst @@ -5,10 +5,12 @@ org.mongodb bson-kotlinx + {+full-version+} org.mongodb bson-kotlin + {+full-version+} \ No newline at end of file