diff --git a/config/redirects b/config/redirects index dffea446a..616020d0f 100644 --- a/config/redirects +++ b/config/redirects @@ -72,3 +72,4 @@ raw: ${prefix}/master -> ${base}/upcoming/ [v5.0-master]: ${prefix}/${version}/quick-reference/ -> ${base}/${version}/getting-started/quick-reference/ [v5.0-master]: ${prefix}/${version}/fundamentals/enterprise-auth/ -> ${base}/${version}/security/enterprise-auth/ [v5.0-master]: ${prefix}/${version}/connection/socks/ -> ${base}/${version}/security/socks/ +[v5.0-*]: ${prefix}/${version}/whats-new/ -> ${base}/${version}/reference/release-notes/ diff --git a/snooty.toml b/snooty.toml index 0ce4c77b3..c7bac4125 100644 --- a/snooty.toml +++ b/snooty.toml @@ -12,8 +12,9 @@ toc_landing_pages = [ "/crud/update-documents", "/aggregation", "/builders", + "/builders/aggregates", "/data-formats", - "/references", + "/reference", "/logging-monitoring", "/api-documentation", "/security", @@ -30,8 +31,9 @@ version = "5.4" full-version = "{+version+}.0" mdb-server = "MongoDB Server" package-name-org = "mongodb-org" -api = "https://mongodb.github.io/mongo-java-driver/{+version+}" -core-api = "https://mongodb.github.io/mongo-java-driver/{+version+}/apidocs/mongodb-driver-core" +api-root = "https://mongodb.github.io/mongo-java-driver/{+version+}/apidocs" +driver-api = "{+api-root+}/mongodb-driver-sync/com/mongodb/client" +core-api = "{+api-root+}/mongodb-driver-core/com/mongodb" stable-api = "Stable API" mongocrypt-version = "{+full-version+}" nettyVersion = "io.netty:netty-all:4.1.87.Final" diff --git a/source/aggregation.txt b/source/aggregation.txt index e16972d2f..c4d4bcb47 100644 --- a/source/aggregation.txt +++ b/source/aggregation.txt @@ -74,7 +74,7 @@ Aggregation operations have some :manual:`limitations `__ + the `allowDiskUse <{+driver-api+}/AggregateIterable.html#allowDiskUse(java.lang.Boolean)>`__ method. .. important:: ``$graphLookup`` exception diff --git a/source/aggregation/aggregation-examples.txt b/source/aggregation/aggregation-examples.txt index 576c9d7e5..298d47179 100644 --- a/source/aggregation/aggregation-examples.txt +++ b/source/aggregation/aggregation-examples.txt @@ -73,7 +73,7 @@ To perform an aggregation, pass a list of aggregation stages to the ``MongoCollection.aggregate()`` method. The Java 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: @@ -106,8 +106,8 @@ The preceding aggregation produces the following results: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `MongoCollection.aggregate() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#aggregate(java.util.List)>`__ -- `Aggregates.match <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#match(org.bson.conversions.Bson)>`__ +- `MongoCollection.aggregate() <{+driver-api+}/MongoCollection.html#aggregate(java.util.List)>`__ +- `Aggregates.match <{+core-api+}/client/model/Aggregates.html#match(org.bson.conversions.Bson)>`__ Explain Aggregation Example ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -161,9 +161,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-sync/com/mongodb/client/FindIterable.html#explain()>`__ API Documentation -- `AggregateIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/AggregateIterable.html>`__ API Documentation +- `ExplainVerbosity <{+core-api+}/ExplainVerbosity>`__ API Documentation +- `explain() <{+driver-api+}/FindIterable.html#explain()>`__ API Documentation +- `AggregateIterable <{+driver-api+}/AggregateIterable.html>`__ API Documentation Aggregation Expression Example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -224,7 +224,7 @@ The preceding aggregation produces the following results: 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/aggregation/aggregation-expression-operations.txt b/source/aggregation/aggregation-expression-operations.txt index 3e96d0d1b..e3abc90f0 100644 --- a/source/aggregation/aggregation-expression-operations.txt +++ b/source/aggregation/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 `. @@ -125,41 +125,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:: @@ -213,29 +213,29 @@ You can perform an arithmetic operation on a value of type ``MqlInteger`` or * - Java 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 ` @@ -286,70 +286,70 @@ using the methods described in this section. * - Java 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 @@ -449,13 +449,13 @@ using the methods described in this section. * - Java 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 @@ -509,32 +509,32 @@ using the methods described in this section. * - Java 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 @@ -570,20 +570,20 @@ this section. * - Java 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 ` @@ -656,17 +656,17 @@ into custom static methods. * - Java 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* @@ -760,25 +760,25 @@ types using the methods described in this section. * - Java 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 @@ -828,34 +828,34 @@ using the methods described in this section. * - Java 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 want to match @@ -914,27 +914,27 @@ using the methods described in this section. * - Java 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 @@ -1008,34 +1008,34 @@ You can perform a map operation on a value of either type ``MqlMap`` or * - Java 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 @@ -1104,25 +1104,25 @@ using the methods described in this section. * - Java 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 want to generate lowercase usernames for employees of a @@ -1177,28 +1177,28 @@ data type, see ``switchOn()``. * - Java 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/api-documentation.txt b/source/api-documentation.txt index 894200ee7..29b7a78d7 100644 --- a/source/api-documentation.txt +++ b/source/api-documentation.txt @@ -7,16 +7,16 @@ API Documentation .. meta:: :description: Read the API documentation for the {+driver-long+} and related packages. -- `BSON <{+api+}/apidocs/bson/index.html>`__ - classes for working with the +- `BSON <{+api-root+}/bson/index.html>`__ - classes for working with the BSON data format. -- `BSON Record Codec <{+api+}/apidocs/bson-record-codec/index.html>`__ - +- `BSON Record Codec <{+api-root+}/bson-record-codec/index.html>`__ - classes for encoding and decoding between Java records and the BSON data format. -- `Core <{+api+}/apidocs/mongodb-driver-core/index.html>`__ - classes that +- `Core <{+api-root+}/mongodb-driver-core/index.html>`__ - classes that contain essential driver functionality. -- `Java Driver (modern API) <{+api+}/apidocs/mongodb-driver-sync/index.html>`__ - +- `Java Driver (modern API) <{+api-root+}/mongodb-driver-sync/index.html>`__ - classes for the current driver API. -- `Java Driver (legacy API) <{+api+}/apidocs/mongodb-driver-legacy/index.html>`__ - +- `Java Driver (legacy API) <{+api-root+}/mongodb-driver-legacy/index.html>`__ - classes that support the legacy driver API. To learn how to upgrade from the legacy API to the modern API from the :ref:`` documentation. @@ -24,9 +24,9 @@ API Documentation :titlesonly: :maxdepth: 1 - BSON <{+api+}/apidocs/bson/index.html> - BSON Record Codec <{+api+}/apidocs/bson-record-codec/index.html> - Core <{+api+}/apidocs/mongodb-driver-core/index.html> - Java Driver (modern API) <{+api+}/apidocs/mongodb-driver-sync/index.html> - Java Driver (legacy API) <{+api+}/apidocs/mongodb-driver-legacy/index.html> + BSON <{+api-root+}/bson/index.html> + BSON Record Codec <{+api-root+}/bson-record-codec/index.html> + Core <{+api-root+}/mongodb-driver-core/index.html> + Java Driver (modern API) <{+api-root+}/mongodb-driver-sync/index.html> + Java Driver (legacy API) <{+api-root+}/mongodb-driver-legacy/index.html> diff --git a/source/atlas-search.txt b/source/atlas-search.txt index 1190644a2..509d6d573 100644 --- a/source/atlas-search.txt +++ b/source/atlas-search.txt @@ -30,10 +30,11 @@ search and which fields to index. Sample Data ~~~~~~~~~~~ -The example in this guide uses the ``movies`` collection in the ``sample_mflix`` +The examples in this guide use the ``movies`` collection in the ``sample_mflix`` database from the :atlas:`Atlas sample datasets `. To learn how to create a free MongoDB Atlas cluster and load the sample datasets, see the -:atlas:`Get Started with Atlas ` guide. +:atlas:`Get Started with Atlas ` guide. To learn more about +aggregation operations and builders, see the :ref:`java-aggregation` guide. Run an Atlas Search Query ------------------------- @@ -41,12 +42,16 @@ Run an Atlas Search Query This section shows how to create an aggregation pipeline to run an Atlas Search query on a collection. You can use the ``Aggregates.search()`` builder method to create a ``$search`` pipeline stage, which specifies the search -criteria. Then, call the ``aggregate()`` method and pass your pipeline as a parameter. +criteria. Then, call the ``aggregate()`` method and pass your pipeline as a +parameter. -.. tip:: +.. note:: Only Available on Atlas for MongoDB v4.2 and later - To learn more about aggregation operations and builders, see the :ref:`java-aggregation` - guide. + 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 `. + Learn more about the required setup and the functionality of this operator + from the :ref:`Atlas Search ` documentation. Before running an Atlas Search query, you must create an Atlas Search index on your collection. To learn how to programmatically create an Atlas Search @@ -90,6 +95,60 @@ following actions: Search queries, see :atlas:`Atlas Search Tutorials ` in the Atlas documentation. +Atlas Search Metadata +--------------------- + +Use the ``searchMeta()`` method to create a :manual:`$searchMeta +` pipeline stage, which returns +only the metadata from of the Atlas full-text search results. + +.. tip:: Only Available on Atlas for MongoDB v4.4.11 and later + + This aggregation pipeline operator is available only + 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 ``near`` metadata for an Atlas search +aggregation stage: + +.. literalinclude:: /includes/fundamentals/code-snippets/builders/AggregateSearchBuilderExample.java + :start-after: // begin atlasSearchMeta + :end-before: // end atlasSearchMeta + :language: java + :dedent: + +Learn more about this helper from the +`searchMeta() API documentation <{+core-api+}/client/model/Aggregates.html#searchMeta(com.mongodb.client.model.search.SearchCollector)>`__. + +.. _java-atlas-search-helpers: + +Create Pipeline Search Stages +----------------------------- + +.. sharedinclude:: dbx/jvm/atlas-search-operator-helpers.rst + + .. replacement:: as-idx-link + + the :ref:`java-search-indexes` section of the Indexes guide + + .. replacement:: atlas-query-operators-example + + .. io-code-block:: + + .. input:: /includes/fundamentals/code-snippets/builders/AggregateSearchBuilderExample.java + :language: java + :start-after: // begin atlasHelperMethods + :end-before: // end atlasHelperMethods + :dedent: + + .. output:: + :language: console + :visible: false + + {"_id": ..., "genres": ["Comedy", "Romance"], "title": "Love at First Bite", "year": 1979} + {"_id": ..., "genres": ["Comedy", "Drama"], "title": "Love Affair", "year": 1994} + Additional Information ---------------------- @@ -102,6 +161,7 @@ API Documentation To learn more about the methods mentioned in this guide, see the following API documentation: -- `MongoCollection.aggregate() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#aggregate(java.util.List)>`__ -- `Aggregates.search() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#search(com.mongodb.client.model.search.SearchCollector)>`__ -- `Aggregates.project() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#project(org.bson.conversions.Bson)>`__ +- `MongoCollection.aggregate() <{+driver-api+}/MongoCollection.html#aggregate(java.util.List)>`__ +- `Aggregates.search() <{+core-api+}/client/model/Aggregates.html#search(com.mongodb.client.model.search.SearchCollector)>`__ +- `Aggregates.project() <{+core-api+}/client/model/Aggregates.html#project(org.bson.conversions.Bson)>`__ +- `SearchOperator <{+core-api+}/client/model/search/SearchOperator.html>`__ diff --git a/source/atlas-vector-search.txt b/source/atlas-vector-search.txt index e60a1d487..831a25561 100644 --- a/source/atlas-vector-search.txt +++ b/source/atlas-vector-search.txt @@ -93,15 +93,15 @@ 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>`__ - `Projections.metaVectorSearchScore() - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Projections.html#metaVectorSearchScore(java.lang.String)>`__ + <{+core-api+}/client/model/Projections.html#metaVectorSearchScore(java.lang.String)>`__ -- `BinaryVector <{+api+}/apidocs/bson/org/bson/BinaryVector.html>`__ \ No newline at end of file +- `BinaryVector <{+api-root+}/bson/org/bson/BinaryVector.html>`__ \ No newline at end of file diff --git a/source/builders/aggregates.txt b/source/builders/aggregates.txt index 54f2b9009..bd9991c04 100644 --- a/source/builders/aggregates.txt +++ b/source/builders/aggregates.txt @@ -17,14 +17,10 @@ Aggregates Builders :depth: 2 :class: singlecol -.. toctree:: - - Atlas Vector Search - 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 Java driver. @@ -258,7 +254,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 by the value @@ -327,7 +323,7 @@ the lowest three ``imdb.rating`` values for movies, grouped by ``year``: :language: java :dedent: -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. .. _java_aggregates_max_n: @@ -347,7 +343,7 @@ return the highest two ``imdb.rating`` values for movies, grouped by ``year``: :language: java :dedent: -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. .. _java_aggregates_first_n: @@ -375,7 +371,7 @@ into the stage, grouped by ``year``: :language: java :dedent: -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. .. _java_aggregates_last_n: @@ -396,7 +392,7 @@ the stage, grouped by ``year``: :language: java :dedent: -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. .. _java_aggregates_top: @@ -417,7 +413,7 @@ the ``title`` and ``imdb.rating`` values for the top rated movies based on the :language: java :dedent: -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. .. _java_aggregates_top_n: @@ -445,7 +441,7 @@ the ``title`` and ``runtime`` values of the three longest movies based on the :language: java :dedent: -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. .. _java_aggregates_bottom: @@ -466,7 +462,7 @@ return the ``title`` and ``runtime`` values of the shortest movie based on the :language: java :dedent: -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. .. _java_aggregates_bottom_n: @@ -493,7 +489,7 @@ based on the ``imdb.rating`` value, grouped by ``year``: :language: java :dedent: -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 @@ -734,7 +730,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:: /includes/fundamentals/code-snippets/builders/AggBuilders.java @@ -771,7 +767,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:: /includes/fundamentals/code-snippets/builders/AggBuilders.java @@ -811,7 +807,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 creates a pipeline stage that computes the @@ -876,7 +872,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 @@ -928,7 +924,7 @@ by the aggregate stage: Document{{_id=6308b..., hour=2, temperature=23.5C, air_pressure=29.75}} Document{{_id=6308c..., 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 @@ -955,7 +951,7 @@ field for text that contains the word "Future": :dedent: 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 --------------------- @@ -982,4 +978,4 @@ aggregation stage: :dedent: 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/builders/filters.txt b/source/builders/filters.txt index 84f9ddb57..b35ebd7db 100644 --- a/source/builders/filters.txt +++ b/source/builders/filters.txt @@ -54,7 +54,7 @@ type, which you can pass to any method that expects a query filter. .. tip:: For brevity, you can 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:: java @@ -113,31 +113,31 @@ The 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 @@ -210,16 +210,16 @@ The 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 @@ -257,13 +257,13 @@ The 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 @@ -298,10 +298,10 @@ The 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 @@ -339,16 +339,16 @@ The 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 a field value produces 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 @@ -385,16 +385,16 @@ The 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 ``bitField`` field @@ -433,28 +433,28 @@ The 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/builders/indexes.txt b/source/builders/indexes.txt index 29bbbf459..c7543afcd 100644 --- a/source/builders/indexes.txt +++ b/source/builders/indexes.txt @@ -31,14 +31,14 @@ the field. See our guide on :ref:`Indexes ` for examples of queries covered by indexes. The ``Indexes`` class provides static factory methods for all the MongoDB index types. -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-sync/com/mongodb/client/MongoCollection.html#createIndex(org.bson.conversions.Bson,com.mongodb.client.model.IndexOptions)>`__. +`createIndex() <{+driver-api+}/MongoCollection.html#createIndex(org.bson.conversions.Bson,com.mongodb.client.model.IndexOptions)>`__. .. tip:: For brevity, you can 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 statically: .. code-block:: java @@ -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`` @@ -84,7 +84,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`` @@ -104,7 +104,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`` @@ -128,7 +128,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`` @@ -150,7 +150,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`` @@ -174,7 +174,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/builders/projections.txt b/source/builders/projections.txt index a44699266..31701626f 100644 --- a/source/builders/projections.txt +++ b/source/builders/projections.txt @@ -32,7 +32,7 @@ to any method that expects a projection. .. tip:: For brevity, you can 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 statically: .. literalinclude:: /includes/fundamentals/code-snippets/builders/Projections.java diff --git a/source/builders/sort.txt b/source/builders/sort.txt index f53526c90..647118b72 100644 --- a/source/builders/sort.txt +++ b/source/builders/sort.txt @@ -68,10 +68,10 @@ class, see our 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>`__ -- `FindIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.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>`__ +- `FindIterable <{+driver-api+}/FindIterable.html>`__ +- `Aggregates <{+core-api+}/client/model/Aggregates.html>`__ Ascending --------- @@ -177,5 +177,5 @@ the ``Sorts.metaTextScore()`` method, see :ref:`the text search section of our sorting fundamentals 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/builders/updates.txt b/source/builders/updates.txt index 1c213d003..5268758cd 100644 --- a/source/builders/updates.txt +++ b/source/builders/updates.txt @@ -36,7 +36,7 @@ type, which you can pass to any method that expects an update argument. .. tip:: For brevity, you can choose to import the methods of the `Updates - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html>`__ + <{+core-api+}/client/model/Updates.html>`__ class statically: .. code-block:: java @@ -65,7 +65,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": @@ -114,7 +114,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: @@ -139,7 +139,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. @@ -171,7 +171,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 by @@ -198,7 +198,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 by @@ -225,7 +225,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": @@ -251,7 +251,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 update the value of a field with the smaller number of the two specified in an update operation. @@ -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. @@ -304,7 +304,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 `. @@ -332,7 +332,7 @@ The preceding example updates 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 `. @@ -360,9 +360,9 @@ The preceding example updates 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. @@ -405,7 +405,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. @@ -433,9 +433,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 pops the first element off of the array value @@ -462,7 +462,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 values from an existing array in an update operation. @@ -489,7 +489,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 value from an existing array in an update operation. @@ -517,7 +517,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 examples pushes "C" to the ``vendor`` array: diff --git a/source/command.txt b/source/command.txt index a648db05c..449584ed0 100644 --- a/source/command.txt +++ b/source/command.txt @@ -74,7 +74,7 @@ API Documentation For more information about the method used to run database commands, see the following API documentation: -- `runCommand() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#runCommand(org.bson.conversions.Bson)>`__ +- `runCommand() <{+driver-api+}/MongoDatabase.html#runCommand(org.bson.conversions.Bson)>`__ Server Manual Entries ~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/connection/mongoclient.txt b/source/connection/mongoclient.txt index b3d8ddd7b..61ba9b685 100644 --- a/source/connection/mongoclient.txt +++ b/source/connection/mongoclient.txt @@ -33,7 +33,7 @@ MongoClient You can connect to and communicate with MongoDB using the ``MongoClient`` class. To create a `MongoClientSettings -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html>`__ object, use the ``MongoClientSettings.builder()`` method and chain methods to specify your +<{+core-api+}/MongoClientSettings.html>`__ object, use the ``MongoClientSettings.builder()`` method and chain methods to specify your settings. After chaining them, use the ``build()`` method to create the ``MongoClientSettings`` object. @@ -255,6 +255,10 @@ class. Select the tab that corresponds to your preferred class. .build(); MongoClient mongoClient = MongoClients.create(settings); +.. note:: Replica Set in Docker + + .. sharedinclude:: dbx/docker-replica-set.rst + Frequently Asked Questions -------------------------- @@ -368,4 +372,4 @@ after any code that calls ``close()`` on it. best practices for managing the connection behavior. To learn more about accessing MongoDB from Spring Boot, see - `Spring Boot and MongoDB `__. \ No newline at end of file + `Spring Boot and MongoDB `__. diff --git a/source/connection/specify-connection-options.txt b/source/connection/specify-connection-options.txt index 73bdad749..e793af476 100644 --- a/source/connection/specify-connection-options.txt +++ b/source/connection/specify-connection-options.txt @@ -22,6 +22,7 @@ Specify Connection Options .. toctree:: Stable API + Limit Execution Time Connection Pools Cluster Settings Server Settings @@ -38,6 +39,7 @@ This section describes the MongoDB connection and authentication options available in the {+driver-short+}. You can specify the following connection options: - :ref:`Stable API ` +- :ref:`Limit Server Execution Time ` - :ref:`Connection Pools ` - :ref:`Cluster Settings ` - :ref:`Server Settings ` diff --git a/source/connection/specify-connection-options/cluster-settings.txt b/source/connection/specify-connection-options/cluster-settings.txt index e7b09d625..1c3be0035 100644 --- a/source/connection/specify-connection-options/cluster-settings.txt +++ b/source/connection/specify-connection-options/cluster-settings.txt @@ -75,6 +75,12 @@ String` or :guilabel:`MongoClientSettings` tab to see the options available: *Default*: ``false`` + * - ``loadBalanced`` + - boolean + - Specifies whether or not the driver is connecting to MongoDB using a load balancer. + + *Default*: ``null`` + * - ``srvServiceName`` - string - Specifies the service name of the `SRV resource records @@ -96,14 +102,14 @@ String` or :guilabel:`MongoClientSettings` tab to see the options available: MongoClient mongoClient = MongoClients.create(connectionString) For more information about these parameters, see the `ConnectionString - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ConnectionString.html>`__ + <{+core-api+}/ConnectionString.html>`__ API documentation. .. tab:: MongoClientSettings :tabid: MongoClient Chain the `applyToClusterSettings() - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToClusterSettings(com.mongodb.Block)>`__ + <{+core-api+}/MongoClientSettings.Builder.html#applyToClusterSettings(com.mongodb.Block)>`__ method to modify the driver's behavior when interacting with your MongoDB cluster. @@ -192,7 +198,7 @@ String` or :guilabel:`MongoClientSettings` tab to see the options available: information. For more information about the chained methods, see the `MongoClientSettings.Builder - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html>`__ + <{+core-api+}/MongoClientSettings.Builder.html>`__ API documentation. \ No newline at end of file diff --git a/source/connection/specify-connection-options/configure-crud.txt b/source/connection/specify-connection-options/configure-crud.txt index c613920a0..5280d9c2a 100644 --- a/source/connection/specify-connection-options/configure-crud.txt +++ b/source/connection/specify-connection-options/configure-crud.txt @@ -109,7 +109,7 @@ string ` or by passing a ``MongoClientSettings`` object to the - 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()>`__. + <{+core-api+}/MongoClientSettings.html#getUuidRepresentation()>`__. *Default*: ``unspecified`` @@ -136,7 +136,7 @@ string ` or by passing a ``MongoClientSettings`` object to the MongoClient mongoClient = MongoClients.create(connectionString) For more information about these parameters, see the `ConnectionString - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ConnectionString.html>`__ + <{+core-api+}/ConnectionString.html>`__ API documentation. .. tab:: MongoClientSettings @@ -151,7 +151,7 @@ string ` or by passing a ``MongoClientSettings`` object to the * - ``readConcern()`` - Sets the read concern. :manual:`Server manual page ` - `API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#readConcern(com.mongodb.ReadConcern)>`__ + `API documentation <{+core-api+}/MongoClientSettings.Builder.html#readConcern(com.mongodb.ReadConcern)>`__ * - ``readPreference()`` - Sets the :manual:`read preference ` @@ -190,7 +190,7 @@ string ` or by passing a ``MongoClientSettings`` object to the :dedent: For more information about these methods, see the `MongoClientSettings.Builder - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#>`__ + <{+core-api+}/MongoClientSettings.Builder.html#>`__ API documentation. \ No newline at end of file diff --git a/source/connection/specify-connection-options/connection-pools.txt b/source/connection/specify-connection-options/connection-pools.txt index 08d4a6ab8..788f1ac4f 100644 --- a/source/connection/specify-connection-options/connection-pools.txt +++ b/source/connection/specify-connection-options/connection-pools.txt @@ -87,10 +87,12 @@ see the corresponding syntax: * - ``maxPoolSize`` - - Maximum number of connections opened in the pool. When the - connection pool reaches the maximum number of connections, new - connections wait up until to the value of - ``waitQueueTimeoutMS``. + - Maximum number of connections opened in the pool. If an + operation needs a new connection while the connection pool has + ``maxPoolSize`` connections open, the new + operation waits for a new connection to open. To limit this + waiting time, use the single timeout setting. To learn more, + see the :ref:`java-csot` guide. *Default:* ``100`` @@ -102,11 +104,15 @@ see the corresponding syntax: *Default*: ``0`` - * - ``waitQueueTimeoutMS`` + * - ``waitQueueTimeoutMS`` *(deprecated)* - - Maximum wait time in milliseconds that an operation can wait for + - 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. + is no limit. *Default*: ``120000`` (120 seconds) @@ -127,13 +133,13 @@ see the corresponding syntax: MongoClient mongoClient = MongoClients.create(connectionString) For more information about these parameters, see the `ConnectionString - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ConnectionString.html>`__ + <{+core-api+}/ConnectionString.html>`__ API documentation. .. tab:: MongoClientSettings :tabid: MongoClient - Chain the `applyToConnectionPoolSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToConnectionPoolSettings(com.mongodb.Block)>`__ method to modify the way the driver manages its connection pool. + 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 the methods you can chain to your settings to modify the driver's behavior: diff --git a/source/connection/specify-connection-options/csot.txt b/source/connection/specify-connection-options/csot.txt new file mode 100644 index 000000000..e6e7719b8 --- /dev/null +++ b/source/connection/specify-connection-options/csot.txt @@ -0,0 +1,350 @@ +.. _java-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:: /includes/connect/CsotExample.java + :language: java + :start-after: start-mongoclientsettings + :end-before: end-mongoclientsettings + :dedent: + :emphasize-lines: 3 + + .. tab:: Connection String + :tabid: connection-string + + .. literalinclude:: /includes/connect/CsotExample.java + :language: java + :start-after: start-string + :end-before: end-string + :dedent: + +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:: /includes/connect/CsotExample.java + :language: java + :start-after: start-operation-timeout + :end-before: end-operation-timeout + :dedent: + +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:`java-csot-overrides` section. + +.. _java-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:: /includes/connect/CsotExample.java + :language: java + :start-after: start-override + :end-before: end-override + :dedent: + :emphasize-lines: 10 + +.. _java-csot-transaction: + +Transactions +~~~~~~~~~~~~ + +When you create a new `ClientSession <{+driver-api+}/ClientSession.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+}/ClientSession.html#commitTransaction()>`__ +- `abortTransaction() <{+driver-api+}/ClientSession.html#abortTransaction()>`__ +- `withTransaction() <{+driver-api+}/ClientSession.html#withTransaction(com.mongodb.client.TransactionBody)>`__ +- `close() <{+core-api+}/session/ClientSession.html#close()>`__ + +The following code demonstrates how to set the ``defaultTimeout`` when +instantiating a ``ClientSession``: + +.. literalinclude:: /includes/connect/CsotExample.java + :language: java + :start-after: start-session-timeout + :end-before: end-session-timeout + :dedent: + +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:: /includes/connect/CsotExample.java + :language: java + :start-after: start-transaction-timeout + :end-before: end-transaction-timeout + :dedent: + +To learn more about transactions, see the :ref:`java-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. + +.. _java-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 an ``Iterable``. + +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, see the :ref:`java-fundamentals-cursor` 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:: /includes/connect/CsotExample.java + :language: java + :start-after: start-cursor-lifetime + :end-before: end-cursor-lifetime + :dedent: + :emphasize-lines: 3 + +Cursor Iteration Mode +~~~~~~~~~~~~~~~~~~~~~ + +The cursor iteration mode sets the timeout to limit each call to +the ``next()``, ``hasNext()``, and ``tryNext()`` methods. The timeout refreshes +after each call completes. This is the default mode for all tailable cursors, +such as the tailable cursors returned by the ``find()`` method on capped +collections or change streams. + +The following code example iterates over documents in the ``db.people`` collection +by using a cursor with the ``ITERATION`` timeout mode, and then retrieves +and prints the ``name`` field value for each document: + +.. literalinclude:: /includes/connect/CsotExample.java + :language: java + :start-after: start-cursor-iteration + :end-before: end-cursor-iteration + :dedent: + :emphasize-lines: 3 + +.. _java-csot-gridfs: + +GridFS +------ + +You can set a timeout option for :ref:`GridFS ` +operations when instantiating a ``GridFSBucket`` by using the +``withTimeout()`` method. This timeout applies to all operations +performed on the bucket, such as uploading and downloading data. If you +do not set a timeout, the ``GridFSBucket`` instance inherits the timeout +setting from the ``MongoDatabase`` it is created with. + +The following code demonstrates how to set a timeout when instantiating +a ``GridFSBucket``: + +.. literalinclude:: /includes/connect/CsotExample.java + :language: java + :start-after: start-gridfsbucket-timeout + :end-before: end-gridfsbucket-timeout + :dedent: + :emphasize-lines: 3 + +.. important:: InputStream Timeout Support + + When you call the ``uploadFromStream()`` method on a ``GridFSBucket`` + that has an operation timeout, timeout breaches might occur because + the ``InputStream`` class lacks inherent read timeout support. This might + extend the operation beyond the specified timeout limit, causing a + timeout exception. + +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+}/MongoCollection.html#withTimeout(long,java.util.concurrent.TimeUnit)>`__ +- `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+}/FindIterable.html#timeoutMode(com.mongodb.client.cursor.TimeoutMode)>`__ +- `TimeoutMode <{+core-api+}/client/cursor/TimeoutMode.html>`__ +- `GridFSBucket.withTimeout() <{+driver-api+}/gridfs/GridFSBucket.html#withTimeout(long,java.util.concurrent.TimeUnit)>`__ diff --git a/source/connection/specify-connection-options/jndi.txt b/source/connection/specify-connection-options/jndi.txt index c1e863479..37df5e2c9 100644 --- a/source/connection/specify-connection-options/jndi.txt +++ b/source/connection/specify-connection-options/jndi.txt @@ -130,5 +130,5 @@ JNDI Datasource. For JNDI implementations other than those listed here, you can create your own ``Factory`` wrapper based on the driver's built-in `MongoClientFactory - <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClientFactory.html>`__ + <{+driver-api+}/MongoClientFactory.html>`__ implementation. diff --git a/source/connection/specify-connection-options/network-compression.txt b/source/connection/specify-connection-options/network-compression.txt index dd50f656a..5e160c834 100644 --- a/source/connection/specify-connection-options/network-compression.txt +++ b/source/connection/specify-connection-options/network-compression.txt @@ -102,7 +102,7 @@ tab to see the corresponding syntax: :language: java For more information about these parameters, see the `ConnectionString - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ConnectionString.html>`__ + <{+core-api+}/ConnectionString.html>`__ API documentation. .. tab:: MongoClientSettings @@ -126,7 +126,7 @@ tab to see the corresponding syntax: :language: java For more information about the chained methods, see the `MongoClientSettings.Builder - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html>`__ + <{+core-api+}/MongoClientSettings.Builder.html>`__ API documentation. .. _java-compression-dependencies: @@ -147,7 +147,7 @@ API Documentation To learn more about any of the methods or types discussed in this guide, see the following API documentation: -- `MongoClient <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html>`__ +- `MongoClient <{+driver-api+}/MongoClient.html>`__ - `createSnappyCompressor() <{+core-api+}/com/mongodb/MongoCompressor.html#createSnappyCompressor()>`__ - `createZlibCompressor() <{+core-api+}/com/mongodb/MongoCompressor.html#createZlibCompressor()>`__ - `createZstdCompressor() <{+core-api+}/com/mongodb/MongoCompressor.html#createZstdCompressor()>`__ \ No newline at end of file diff --git a/source/connection/specify-connection-options/server-settings.txt b/source/connection/specify-connection-options/server-settings.txt index 5a8e76929..0c6a63150 100644 --- a/source/connection/specify-connection-options/server-settings.txt +++ b/source/connection/specify-connection-options/server-settings.txt @@ -75,14 +75,14 @@ Configuring Server Settings MongoClient mongoClient = MongoClients.create(connectionString) For more information about these parameters, see the `ConnectionString - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ConnectionString.html>`__ + <{+core-api+}/ConnectionString.html>`__ API documentation. .. tab:: MongoClientSettings :tabid: MongoClient - Chain the `applyToServerSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToServerSettings(com.mongodb.Block)>`__ method to modify the driver's behavior when monitoring each MongoDB deployment. + Chain the `applyToServerSettings() <{+core-api+}/MongoClientSettings.Builder.html#applyToServerSettings(com.mongodb.Block)>`__ method to modify the driver's behavior when monitoring each MongoDB deployment. The following table describes the methods you can chain to your settings to modify the driver's behavior: @@ -126,7 +126,7 @@ Configuring Server Settings :dedent: For more information about the chained methods, see the `MongoClientSettings.Builder - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html>`__ + <{+core-api+}/MongoClientSettings.Builder.html>`__ API documentation. diff --git a/source/connection/specify-connection-options/socket-settings.txt b/source/connection/specify-connection-options/socket-settings.txt index 77f0ee5af..419cb5572 100644 --- a/source/connection/specify-connection-options/socket-settings.txt +++ b/source/connection/specify-connection-options/socket-settings.txt @@ -64,13 +64,13 @@ string ` or by passing a ``MongoClientSettings`` object to the MongoClient mongoClient = MongoClients.create(connectionString) For more information about these parameters, see the `ConnectionString - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ConnectionString.html>`__ + <{+core-api+}/ConnectionString.html>`__ API documentation. .. tab:: MongoClientSettings :tabid: MongoClient - 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 deployment. @@ -134,7 +134,7 @@ string ` or by passing a ``MongoClientSettings`` object to the :dedent: For more information about the chained methods, see the `MongoClientSettings.Builder - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html>`__ + <{+core-api+}/MongoClientSettings.Builder.html>`__ API documentation. diff --git a/source/connection/specify-connection-options/stable-api.txt b/source/connection/specify-connection-options/stable-api.txt index ec9168631..b50973b0f 100644 --- a/source/connection/specify-connection-options/stable-api.txt +++ b/source/connection/specify-connection-options/stable-api.txt @@ -5,8 +5,6 @@ {+stable-api+} ============== - - .. contents:: On this page :local: :backlinks: none @@ -95,14 +93,14 @@ following operations: For more information about 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>`__ -- `MongoClients.create() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClients.html#create(com.mongodb.MongoClientSettings)>`__ -- `MongoClient <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.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>`__ +- `MongoClients.create() <{+driver-api+}/MongoClients.html#create(com.mongodb.MongoClientSettings)>`__ +- `MongoClient <{+driver-api+}/MongoClient.html>`__ .. _versioned-api-options: .. _stable-api-options: @@ -145,6 +143,5 @@ of ``ServerApi`` by chaining methods on the ``ServerApi.Builder``: For more information about 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/crud.txt b/source/crud.txt index 8a5f3277e..e1dd28036 100644 --- a/source/crud.txt +++ b/source/crud.txt @@ -18,3 +18,15 @@ CRUD Operations Collations Large File Storage with GridFS Configure Custom CRUD Settings + +- :ref:`Insert Documents ` +- :ref:`Query Documents ` +- :ref:`Update Documents ` +- :ref:`Replace Documents ` +- :ref:`Delete Documents ` +- :ref:`Bulk Operations ` +- :ref:`Compound Operations ` +- :ref:`Transactions ` +- :ref:`Collations ` +- :ref:`Large File Storage with GridFS ` +- :ref:`Configure Custom CRUD Settings ` diff --git a/source/crud/bulk.txt b/source/crud/bulk.txt index d0bbdc524..1a2477b2d 100644 --- a/source/crud/bulk.txt +++ b/source/crud/bulk.txt @@ -79,9 +79,9 @@ document. The examples in each section use the following documents in the For more information about the methods and classes mentioned in this section, see the following API documentation: -- `bulkWrite() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#bulkWrite(java.util.List,com.mongodb.client.model.BulkWriteOptions)>`__ -- `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+}/MongoCollection.html#bulkWrite(java.util.List,com.mongodb.client.model.BulkWriteOptions)>`__ +- `WriteModel <{+core-api+}/client/model/WriteModel.html>`__ +- `BulkWriteOptions <{+core-api+}/client/model/BulkWriteOptions.html>`__ Insert Operation ~~~~~~~~~~~~~~~~ @@ -132,7 +132,7 @@ describing people: 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>`__ +<{+core-api+}/client/model/InsertOneModel.html>`__ API documentation. Replace Operation @@ -176,10 +176,10 @@ 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>`__ + <{+core-api+}/client/model/ReplaceOneModel.html>`__ API documentation - `ReplaceOptions - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/ReplaceOptions.html>`__ + <{+core-api+}/client/model/ReplaceOptions.html>`__ API documentation - :manual:`Unique indexes ` Server Manual Explanation @@ -227,13 +227,13 @@ 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>`__ + <{+core-api+}/client/model/UpdateOneModel.html>`__ API documentation - `UpdateManyModel - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/UpdateManyModel.html>`__ + <{+core-api+}/client/model/UpdateManyModel.html>`__ API documentation - `UpdateOptions - <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/UpdateOptions.html>`__ + <{+core-api+}/client/model/UpdateOptions.html>`__ API documentation - :manual:`unique indexes ` Server Manual Explanation @@ -269,8 +269,8 @@ a document where the ``_id`` is ``1``: 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: @@ -355,8 +355,8 @@ operations to execute in any order: 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)>`__ .. _java-usage-bulkwrite: @@ -503,10 +503,10 @@ To learn more about the methods and classes mentioned in this section, see the following API documentation: - `bulkWrite() - <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCluster.html#bulkWrite(java.util.List,com.mongodb.client.model.bulk.ClientBulkWriteOptions)>`__ + <{+driver-api+}/MongoCluster.html#bulkWrite(java.util.List,com.mongodb.client.model.bulk.ClientBulkWriteOptions)>`__ - `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>`__ .. _java-sync-client-bulk-write-insert: @@ -548,7 +548,7 @@ value of ``"electronic"`` in the ``things`` 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 driver performs the update operation, as shown in the following code: @@ -580,7 +580,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: @@ -635,16 +635,16 @@ operations in this section, see the following API documentation: MongoCollection ``````````````` -- `bulkWrite() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#bulkWrite(com.mongodb.client.ClientSession,java.util.List)>`__ -- `BulkWriteOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/BulkWriteOptions.html>`__ -- `MongoBulkWriteException <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoBulkWriteException.html>`__ +- `bulkWrite() <{+driver-api+}/MongoCollection.html#bulkWrite(com.mongodb.client.ClientSession,java.util.List)>`__ +- `BulkWriteOptions <{+core-api+}/client/model/BulkWriteOptions.html>`__ +- `MongoBulkWriteException <{+core-api+}/MongoBulkWriteException.html>`__ MongoClient ``````````` -- `bulkWrite() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCluster.html#bulkWrite(com.mongodb.client.ClientSession,java.util.List)>`__ -- `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>`__ +- `bulkWrite() <{+driver-api+}/MongoCluster.html#bulkWrite(com.mongodb.client.ClientSession,java.util.List)>`__ +- `ClientBulkWriteOptions <{+core-api+}/client/model/bulk/ClientBulkWriteOptions.html>`__ +- `ClientBulkWriteResult <{+core-api+}/client/model/bulk/ClientBulkWriteResult.html>`__ Server Manual Entries ~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/crud/collations.txt b/source/crud/collations.txt index 5305d37da..b98d66801 100644 --- a/source/crud/collations.txt +++ b/source/crud/collations.txt @@ -1,9 +1,9 @@ +.. _java-crud-collations: + ========== Collations ========== - - .. contents:: On this page :local: :backlinks: none @@ -258,39 +258,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 about 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 about 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 @@ -304,7 +304,7 @@ preceding collation options. You can call the ``build()`` method to construct a For more information about 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: @@ -369,9 +369,9 @@ the output resembles the following: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `find() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#find()>`__ -- `sort() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.html#sort(org.bson.conversions.Bson)>`__ -- `Sorts <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Sorts.html>`__ +- `find() <{+driver-api+}/MongoCollection.html#find()>`__ +- `sort() <{+driver-api+}/FindIterable.html#sort(org.bson.conversions.Bson)>`__ +- `Sorts <{+core-api+}/client/model/Sorts.html>`__ findOneAndUpdate() Example ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -418,11 +418,11 @@ returns the following update document: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `findOneAndUpdate <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#findOneAndUpdate(org.bson.conversions.Bson,java.util.List,com.mongodb.client.model.FindOneAndUpdateOptions)>`__ -- `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+}/MongoCollection.html#findOneAndUpdate(org.bson.conversions.Bson,java.util.List,com.mongodb.client.model.FindOneAndUpdateOptions)>`__ +- `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 @@ -478,10 +478,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-sync/com/mongodb/client/MongoCollection.html#findOneAndDelete(org.bson.conversions.Bson)>`__ -- `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+}/MongoCollection.html#findOneAndDelete(org.bson.conversions.Bson)>`__ +- `FindOneAndDeleteOptions <{+core-api+}/client/model/FindOneAndDeleteOptions.html>`__ +- `Filters <{+core-api+}/client/model/Filters.html>`__ +- `Sorts <{+core-api+}/client/model/Sorts.html>`__ Aggregation Example ~~~~~~~~~~~~~~~~~~~ @@ -530,10 +530,10 @@ The preceding code outputs the following documents: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `aggregate() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#aggregate(java.util.List)>`__ -- `AggregateIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/AggregateIterable.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+}/MongoCollection.html#aggregate(java.util.List)>`__ +- `AggregateIterable <{+driver-api+}/AggregateIterable.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/crud/compound-operations.txt b/source/crud/compound-operations.txt index 1894761e2..3fe24b6b5 100644 --- a/source/crud/compound-operations.txt +++ b/source/crud/compound-operations.txt @@ -83,9 +83,6 @@ following options: - Exclude the ``_id`` field from the found document with a projection. - Specify an upsert, which inserts the document specified by the query filter if no documents match the query. -- Set a maximum execution time of 5 seconds for this operation on the MongoDB - instance. If the operation takes longer, the ``findOneAndUpdate()`` method - will throw a ``MongoExecutionTimeoutException``. .. literalinclude:: /includes/fundamentals/code-snippets/CompoundOperatorsIndividualExamples.java :language: java @@ -109,9 +106,9 @@ For more information about 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-sync/com/mongodb/client/MongoCollection.html#findOneAndUpdate(org.bson.conversions.Bson,java.util.List,com.mongodb.client.model.FindOneAndUpdateOptions)>`__ -- `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+}/MongoCollection.html#findOneAndUpdate(org.bson.conversions.Bson,java.util.List,com.mongodb.client.model.FindOneAndUpdateOptions)>`__ +- `FindOneAndUpdateOptions <{+core-api+}/client/model/FindOneAndUpdateOptions.html>`__ +- `MongoExecutionTimeoutException <{+core-api+}/MongoExecutionTimeoutException.html>`__ .. _java-find-and-replace-example: @@ -154,8 +151,8 @@ The output of the preceding code resembles the following: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `findOneAndReplace() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#findOneAndReplace(org.bson.conversions.Bson,TDocument,com.mongodb.client.model.FindOneAndReplaceOptions)>`__ -- `FindOneAndReplaceOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/FindOneAndReplaceOptions.html>`__ +- `findOneAndReplace() <{+driver-api+}/MongoCollection.html#findOneAndReplace(org.bson.conversions.Bson,TDocument,com.mongodb.client.model.FindOneAndReplaceOptions)>`__ +- `FindOneAndReplaceOptions <{+core-api+}/client/model/FindOneAndReplaceOptions.html>`__ Find and Delete ~~~~~~~~~~~~~~~ @@ -192,8 +189,8 @@ For more information about 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-sync/com/mongodb/client/MongoCollection.html#findOneAndDelete(org.bson.conversions.Bson,com.mongodb.client.model.FindOneAndDeleteOptions)>`__ -- `FindOneAndDeleteOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/FindOneAndDeleteOptions.html>`__ +- `findOneAndDelete() <{+driver-api+}/MongoCollection.html#findOneAndDelete(org.bson.conversions.Bson,com.mongodb.client.model.FindOneAndDeleteOptions)>`__ +- `FindOneAndDeleteOptions <{+core-api+}/client/model/FindOneAndDeleteOptions.html>`__ Avoiding a Race Condition ------------------------- @@ -324,4 +321,4 @@ For more information of the ``Filters`` class, see our :ref:`guide on the Filters builder `. For more information about the ``findOneAndUpdate()`` method, see -the API Documentation for the `MongoCollection class <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#findOneAndUpdate(org.bson.conversions.Bson,java.util.List,com.mongodb.client.model.FindOneAndUpdateOptions)>`__. +the API Documentation for the `MongoCollection class <{+driver-api+}/MongoCollection.html#findOneAndUpdate(org.bson.conversions.Bson,java.util.List,com.mongodb.client.model.FindOneAndUpdateOptions)>`__. diff --git a/source/crud/crud-settings.txt b/source/crud/crud-settings.txt index e5c8b0296..ab8322fe9 100644 --- a/source/crud/crud-settings.txt +++ b/source/crud/crud-settings.txt @@ -28,17 +28,17 @@ and concerns from the ``MongoClient`` that accesses them. See the more information. However, you can apply custom settings to your individual databases and collections by using the following methods: -- `MongoDatabase.withReadConcern() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#withReadConcern(com.mongodb.ReadConcern)>`__ +- `MongoDatabase.withReadConcern() <{+driver-api+}/MongoDatabase.html#withReadConcern(com.mongodb.ReadConcern)>`__ -- `MongoDatabase.withReadPreference() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#withReadPreference(com.mongodb.ReadPreference)>`__ +- `MongoDatabase.withReadPreference() <{+driver-api+}/MongoDatabase.html#withReadPreference(com.mongodb.ReadPreference)>`__ -- `MongoDatabase.withWriteConcern() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#withWriteConcern(com.mongodb.WriteConcern)>`__ +- `MongoDatabase.withWriteConcern() <{+driver-api+}/MongoDatabase.html#withWriteConcern(com.mongodb.WriteConcern)>`__ -- `MongoCollection.withReadConcern() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#withReadConcern(com.mongodb.ReadConcern)>`__ +- `MongoCollection.withReadConcern() <{+driver-api+}/MongoCollection.html#withReadConcern(com.mongodb.ReadConcern)>`__ -- `MongoCollection.withReadPreference() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#withReadPreference(com.mongodb.ReadPreference)>`__ +- `MongoCollection.withReadPreference() <{+driver-api+}/MongoCollection.html#withReadPreference(com.mongodb.ReadPreference)>`__ -- `MongoCollection.withWriteConcern() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#withWriteConcern(com.mongodb.WriteConcern)>`__ +- `MongoCollection.withWriteConcern() <{+driver-api+}/MongoCollection.html#withWriteConcern(com.mongodb.WriteConcern)>`__ .. tip:: diff --git a/source/crud/delete.txt b/source/crud/delete.txt index 1706fa1e6..20309ad40 100644 --- a/source/crud/delete.txt +++ b/source/crud/delete.txt @@ -182,7 +182,7 @@ operation and a delete many operation: The queries in these examples use the ``eq()`` and ``lt()`` filters to query documents. For more information about filters, see the `Filters Class -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html>`__ +<{+core-api+}/client/model/Filters.html>`__ API documentation. Additional Information @@ -193,12 +193,12 @@ API Documentation For more information about the methods and classes used to delete documents, see the following API documentation: -- `deleteOne() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#deleteOne(org.bson.conversions.Bson)>`__ -- `deleteMany() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#deleteMany(org.bson.conversions.Bson)>`__ -- `findOneAndDelete() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#findOneAndDelete(org.bson.conversions.Bson)>`__ -- `DeleteOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/DeleteOptions.html>`__ -- `FindOneAndDeleteOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/FindOneAndDeleteOptions.html>`__ -- `DeleteResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/DeleteResult.html>`__ +- `deleteOne() <{+driver-api+}/MongoCollection.html#deleteOne(org.bson.conversions.Bson)>`__ +- `deleteMany() <{+driver-api+}/MongoCollection.html#deleteMany(org.bson.conversions.Bson)>`__ +- `findOneAndDelete() <{+driver-api+}/MongoCollection.html#findOneAndDelete(org.bson.conversions.Bson)>`__ +- `DeleteOptions <{+core-api+}/client/model/DeleteOptions.html>`__ +- `FindOneAndDeleteOptions <{+core-api+}/client/model/FindOneAndDeleteOptions.html>`__ +- `DeleteResult <{+core-api+}/client/result/DeleteResult.html>`__ Server Manual Entries ~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/crud/gridfs.txt b/source/crud/gridfs.txt index 54512cd82..93839ce96 100644 --- a/source/crud/gridfs.txt +++ b/source/crud/gridfs.txt @@ -1,3 +1,5 @@ +.. _java-crud-gridfs: + ============================== Large File Storage with GridFS ============================== @@ -20,26 +22,35 @@ Overview -------- In this guide, you can learn how to store and retrieve large files in -MongoDB using **GridFS**. GridFS is a specification implemented by the -driver that describes how to split files into chunks when storing them +MongoDB by using **GridFS**. GridFS is a specification implemented by the +{+driver-short+} that describes how to split files into chunks when storing them and reassemble them when retrieving them. The driver implementation of GridFS is an abstraction that manages the operations and organization of -the file storage. +the file storage in your Java application. + +Use GridFS if the size of your files exceed the BSON document +size limit of 16MB. To learn more about whether GridFS is +suitable for your use case, see the :manual:`GridFS ` +reference in the {+mdb-server+} manual. + +The following sections describe GridFS operations and demonstrate how to +perform these actions with the driver: -You should use GridFS if the size of your files exceed the BSON document -size limit of 16MB. For more detailed information on whether GridFS is -suitable for your use case, see the :manual:`GridFS server manual page `. +- :ref:`gridfs-create-bucket` +- :ref:`gridfs-store-files` +- :ref:`gridfs-retrieve-file-info` +- :ref:`gridfs-download-files` +- :ref:`gridfs-rename-files` +- :ref:`gridfs-delete-files` +- :ref:`gridfs-delete-bucket` -See the following sections that describe GridFS operations and how to -perform them: +.. tip:: Timeout Setting -- :ref:`Create a GridFS bucket ` -- :ref:`Store Files ` -- :ref:`Retrieve File Information ` -- :ref:`Download Files ` -- :ref:`Rename Files ` -- :ref:`Delete Files ` -- :ref:`Delete a GridFS bucket ` + You can use the client-side operation timeout (CSOT) setting to limit + the amount of time in which the server can finish GridFS operations. + To learn more about using this setting with GridFS, see the + :ref:`java-csot-gridfs` section of the Limit Server Execution Time + guide. How GridFS Works ---------------- @@ -114,8 +125,8 @@ method as shown below: For more information about the classes and methods mentioned in this section, see the following API Documentation: -- `GridFSBuckets <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/gridfs/GridFSBuckets.html>`__ -- `GridFSBucket <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/gridfs/GridFSBucket.html>`__ +- `GridFSBuckets <{+driver-api+}/gridfs/GridFSBuckets.html>`__ +- `GridFSBucket <{+driver-api+}/gridfs/GridFSBucket.html>`__ .. _gridfs-store-files: @@ -136,7 +147,7 @@ following code snippet: :start-after: start uploadOptions :end-before: end uploadOptions -See the `GridFSUploadOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/gridfs/model/GridFSUploadOptions.html>`__ +See the `GridFSUploadOptions <{+core-api+}/client/gridfs/model/GridFSUploadOptions.html>`__ API Documentation for more information. .. important:: Use a ``MAJORITY`` Write Concern @@ -172,7 +183,7 @@ This code example prints the file id of the uploaded file after it is successfully saved in GridFS. For more information, see the API Documentation on -`uploadFromStream() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/gridfs/GridFSBucket.html#uploadFromStream(java.lang.String,java.io.InputStream,com.mongodb.client.gridfs.model.GridFSUploadOptions)>`__. +`uploadFromStream() <{+driver-api+}/gridfs/GridFSBucket.html#uploadFromStream(java.lang.String,java.io.InputStream,com.mongodb.client.gridfs.model.GridFSUploadOptions)>`__. Upload a File Using an Output Stream ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -210,7 +221,7 @@ successfully saved in GridFS. write operations. For more information, see the API Documentation on -`GridFSUploadStream <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/gridfs/GridFSUploadStream.html>`__. +`GridFSUploadStream <{+driver-api+}/gridfs/GridFSUploadStream.html>`__. .. _gridfs-retrieve-file-info: @@ -261,8 +272,8 @@ for more information. For more information about the classes and methods mentioned in this section, see the following resources: -- `GridFSFindIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/gridfs/GridFSFindIterable.html>`__ API Documentation -- `GridFSBucket.find() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/gridfs/GridFSBucket.html#find(org.bson.conversions.Bson)>`__ API Documentation +- `GridFSFindIterable <{+driver-api+}/gridfs/GridFSFindIterable.html>`__ API Documentation +- `GridFSBucket.find() <{+driver-api+}/gridfs/GridFSBucket.html#find(org.bson.conversions.Bson)>`__ API Documentation - :ref:`Sort Results ` - :ref:`Limit the Number of Returned Results ` @@ -297,7 +308,7 @@ of a file in an instance of ``GridFSDownloadOptions``: GridFSDownloadOptions downloadOptions = new GridFSDownloadOptions().revision(1); For more information about the enumeration of revisions, see the API -documentation for `GridFSDownloadOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/gridfs/model/GridFSDownloadOptions.html>`__. +documentation for `GridFSDownloadOptions <{+core-api+}/client/gridfs/model/GridFSDownloadOptions.html>`__. Download a File to an Output Stream ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -314,7 +325,7 @@ download the first revision of the file named "myProject.zip" to an :end-before: end downloadToStream For more information about this method, see the -`downloadToStream() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/gridfs/GridFSBucket.html#downloadToStream(java.lang.String,java.io.OutputStream,com.mongodb.client.gridfs.model.GridFSDownloadOptions)>`__ +`downloadToStream() <{+driver-api+}/gridfs/GridFSBucket.html#downloadToStream(java.lang.String,java.io.OutputStream,com.mongodb.client.gridfs.model.GridFSDownloadOptions)>`__ API Documentation. Download a File to an Input Stream @@ -336,7 +347,7 @@ the ``fileId`` variable into memory and print its contents as a string: For more information about this method, see the `openDownloadStream() -<{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/gridfs/GridFSBucket.html#openDownloadStream(java.lang.String,com.mongodb.client.gridfs.model.GridFSDownloadOptions)>`__. +<{+driver-api+}/gridfs/GridFSBucket.html#openDownloadStream(java.lang.String,com.mongodb.client.gridfs.model.GridFSDownloadOptions)>`__. API Documentation. .. _gridfs-rename-files: @@ -366,7 +377,7 @@ by the ``fileId`` variable to "mongodbTutorial.zip": :end-before: end renameFile For more information about this method, see the -`rename() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/gridfs/GridFSBucket.html#rename(org.bson.types.ObjectId,java.lang.String)>`__ +`rename() <{+driver-api+}/gridfs/GridFSBucket.html#rename(org.bson.types.ObjectId,java.lang.String)>`__ API Documentation. .. _gridfs-delete-files: @@ -394,7 +405,7 @@ The following code example shows you how to delete the file referenced by the :end-before: end deleteFile For more information about this method, see the -`delete() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/gridfs/GridFSBucket.html#delete(org.bson.types.ObjectId)>`__ +`delete() <{+driver-api+}/gridfs/GridFSBucket.html#delete(org.bson.types.ObjectId)>`__ API Documentation. .. _gridfs-delete-bucket: @@ -414,14 +425,13 @@ see the section of this guide on :end-before: end dropBucket For more information about this method, see the -`drop() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/gridfs/GridFSBucket.html#drop()>`__ +`drop() <{+driver-api+}/gridfs/GridFSBucket.html#drop()>`__ API Documentation. -Additional Resources --------------------- +Additional Information +---------------------- - `MongoDB GridFS specification `__ -- Runnable example - `GridFSTour.java `__ - from the MongoDB Java Driver repository. - +- Runnable file `GridFSTour.java + `__ + from the driver source repository diff --git a/source/crud/insert.txt b/source/crud/insert.txt index 35102847e..84a9cc5c6 100644 --- a/source/crud/insert.txt +++ b/source/crud/insert.txt @@ -89,8 +89,8 @@ The output of the preceding code resembles the following: For more information about the methods and classes mentioned in this section, see the following resources: -- `insertOne() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#insertOne(TDocument)>`__ API Documentation -- `InsertOneResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/InsertOneResult.html>`__ API Documentation +- `insertOne() <{+driver-api+}/MongoCollection.html#insertOne(TDocument)>`__ API Documentation +- `InsertOneResult <{+core-api+}/client/result/InsertOneResult.html>`__ API Documentation - Manual Explanation on :manual:`insertOne() ` - Runnable :ref:`Insert a Document Example ` @@ -197,10 +197,10 @@ API Documentation For more information about the methods and classes used to insert documents, see the following API documentation: -- `insertOne() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#insertOne(TDocument)>`__ -- `InsertOneResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/InsertOneResult.html>`__ -- `insertMany() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#insertMany(java.util.List)>`__ -- `InsertManyResult <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/result/InsertManyResult.html>`__ +- `insertOne() <{+driver-api+}/MongoCollection.html#insertOne(TDocument)>`__ +- `InsertOneResult <{+core-api+}/client/result/InsertOneResult.html>`__ +- `insertMany() <{+driver-api+}/MongoCollection.html#insertMany(java.util.List)>`__ +- `InsertManyResult <{+core-api+}/client/result/InsertManyResult.html>`__ Server Manual Entries ~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/crud/query-documents.txt b/source/crud/query-documents.txt index b416f9759..335df6aab 100644 --- a/source/crud/query-documents.txt +++ b/source/crud/query-documents.txt @@ -22,8 +22,6 @@ Query Documents Search Text Access Data from a Cursor - - - :ref:`Specify a Query ` - :ref:`Find Documents ` - :ref:`Access Data from a Cursor ` diff --git a/source/crud/query-documents/count.txt b/source/crud/query-documents/count.txt index b4c4b24de..8e0520884 100644 --- a/source/crud/query-documents/count.txt +++ b/source/crud/query-documents/count.txt @@ -125,10 +125,10 @@ API Documentation For more information about the classes and methods used to count documents, see the following API documentation: -- `countDocuments() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#countDocuments()>`__ -- `estimatedDocumentCount() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#estimatedDocumentCount()>`__ -- `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+}/MongoCollection.html#countDocuments()>`__ +- `estimatedDocumentCount() <{+driver-api+}/MongoCollection.html#estimatedDocumentCount()>`__ +- `CountOptions <{+core-api+}/client/model/CountOptions.html>`__ +- `EstimatedDocumentCountOptions <{+core-api+}/client/model/EstimatedDocumentCountOptions.html>`__ Server Manual Entries ~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/crud/query-documents/cursor.txt b/source/crud/query-documents/cursor.txt index 9dae11158..cb39b42f1 100644 --- a/source/crud/query-documents/cursor.txt +++ b/source/crud/query-documents/cursor.txt @@ -4,8 +4,6 @@ Access Data From a Cursor ========================= - - .. contents:: On this page :local: :backlinks: none @@ -15,8 +13,8 @@ Access Data From a Cursor Overview -------- -In this guide, you can learn how to access data using a **cursor** with the -MongoDB Java driver. +In this guide, you can learn how to access data by using a **cursor** in +the {+driver-short+}. A cursor is a mechanism that allows an application to iterate over database results while only holding a subset of them in memory at a given time. The @@ -25,19 +23,25 @@ matched documents in batches as opposed to returning them all at once. This page uses an initiating method, ``find()`` to show how to access data from a `FindIterable -<{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.html>`__. +<{+driver-api+}/FindIterable.html>`__. .. note:: The following ways to access and store data apply to other iterables such as an `AggregateIterable - <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/AggregateIterable.html>`__. + <{+driver-api+}/AggregateIterable.html>`__. The ``find()`` method creates and returns an instance of a ``FindIterable``. A ``FindIterable`` allows you to browse the documents matched by your search criteria and to further specify which documents to see by setting parameters through methods. +.. tip:: Cursor Timeout + + You can set a timeout on your cursor to return query results. + To learn more, see the :ref:`java-csot-cursor` section of the Limit + Server Execution Time guide. + Terminal Methods ---------------- @@ -140,12 +144,12 @@ Server Manual Entries: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `first() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoIterable.html#first()>`__ -- `available() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCursor.html#available()>`__ -- `into() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoIterable.html#into(A)>`__ -- `cursor() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoIterable.html#cursor()>`__ -- `explain() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.html#explain()>`__ -- `ExplainVerbosity <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ExplainVerbosity>`__ +- `first() <{+driver-api+}/MongoIterable.html#first()>`__ +- `available() <{+driver-api+}/MongoCursor.html#available()>`__ +- `into() <{+driver-api+}/MongoIterable.html#into(A)>`__ +- `cursor() <{+driver-api+}/MongoIterable.html#cursor()>`__ +- `explain() <{+driver-api+}/FindIterable.html#explain()>`__ +- `ExplainVerbosity <{+core-api+}/ExplainVerbosity>`__ Usage Patterns -------------- @@ -201,8 +205,8 @@ For more information about the methods and classes mentioned in this section, see the following API Documentation: - `forEach() `__ -- `hasNext() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCursor.html#hasNext()>`__ -- `next() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCursor.html#next()>`__ +- `hasNext() <{+driver-api+}/MongoCursor.html#hasNext()>`__ +- `next() <{+driver-api+}/MongoCursor.html#next()>`__ .. _cursor_cleanup: @@ -238,5 +242,5 @@ client application and the MongoDB deployment: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `close() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCursor.html#close()>`__ +- `close() <{+driver-api+}/MongoCursor.html#close()>`__ - `try-with-resources statement `__ diff --git a/source/crud/query-documents/distinct.txt b/source/crud/query-documents/distinct.txt index 39e5829d2..7c425b1b5 100644 --- a/source/crud/query-documents/distinct.txt +++ b/source/crud/query-documents/distinct.txt @@ -85,7 +85,7 @@ which resembles the following: For more information about the classes and methods mentioned on this page, see the following resources: -- `distinct() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#distinct(java.lang.String,java.lang.Class)>`__ API Documentation -- `DistinctIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/DistinctIterable.html>`__ API Documentation +- `distinct() <{+driver-api+}/MongoCollection.html#distinct(java.lang.String,java.lang.Class)>`__ API Documentation +- `DistinctIterable <{+driver-api+}/DistinctIterable.html>`__ API Documentation - :manual:`Dot Notation ` Server Manual Entry -- `MongoIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoIterable.html>`__ API Documentation +- `MongoIterable <{+driver-api+}/MongoIterable.html>`__ API Documentation diff --git a/source/crud/query-documents/find.txt b/source/crud/query-documents/find.txt index 96d4238bf..4dc0f3933 100644 --- a/source/crud/query-documents/find.txt +++ b/source/crud/query-documents/find.txt @@ -10,7 +10,7 @@ Find Documents .. meta:: :keywords: find, findOne, findMany, get, lookup, code example - :description: Learn about how to retrieve documents in the {+driver-long+}. + :description: Learn about how to retrieve documents in the Java Sync Driver. .. contents:: On this page :local: @@ -60,7 +60,7 @@ specify a query, see our :ref:`java-query` guide. You can then use methods such as ``forEach()`` or ``cursor()`` to retrieve matching documents. For more information, see the `FindIterable -<{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.html>`__ +<{+driver-api+}/FindIterable.html>`__ API documentation. To retrieve a single document, you can add the ``first()`` method to your @@ -186,18 +186,22 @@ API Documentation For more information about the methods and classes used to retrieve documents on this page, see the following API documentation: -- `find() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#find()>`__ -- `first() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoIterable.html#first()>`__ -- `limit() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.html#limit(int)>`__ -- `FindIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.html>`__ -- `aggregate() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#aggregate(java.util.List)>`__ +- `find() <{+driver-api+}/MongoCollection.html#find()>`__ +- `first() <{+driver-api+}/MongoIterable.html#first()>`__ +- `limit() <{+driver-api+}/FindIterable.html#limit(int)>`__ +- `FindIterable <{+driver-api+}/FindIterable.html>`__ +- `aggregate() <{+driver-api+}/MongoCollection.html#aggregate(java.util.List)>`__ Server Manual Entries ~~~~~~~~~~~~~~~~~~~~~ - :manual:`Collections ` + - :manual:`Query Documents ` + - :manual:`Aggregation ` - - :manual:`$sort ` - - :manual:`$limit ` -- :manual:`Aggregation stages ` + + - :manual:`$sort ` + - :manual:`$limit ` + +- :manual:`Aggregation Stages ` diff --git a/source/crud/query-documents/geo.txt b/source/crud/query-documents/geo.txt index 6d6d12569..a4b2de10a 100644 --- a/source/crud/query-documents/geo.txt +++ b/source/crud/query-documents/geo.txt @@ -227,7 +227,7 @@ Java driver. For a full list of the GeoJSON shapes available in the MongoDB Java driver, see the `GeoJSON package -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/geojson/package-summary.html>`__ +<{+core-api+}/client/model/geojson/package-summary.html>`__ API Documentation. .. external resource diff --git a/source/crud/query-documents/limit.txt b/source/crud/query-documents/limit.txt index 1ccb097db..43c367eee 100644 --- a/source/crud/query-documents/limit.txt +++ b/source/crud/query-documents/limit.txt @@ -162,7 +162,7 @@ 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: -- `FindIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.html>`__ -- `MongoIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoIterable.html>`__ -- `MongoCursor <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCursor.html>`__ -- `find() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#find()>`__ +- `FindIterable <{+driver-api+}/FindIterable.html>`__ +- `MongoIterable <{+driver-api+}/MongoIterable.html>`__ +- `MongoCursor <{+driver-api+}/MongoCursor.html>`__ +- `find() <{+driver-api+}/MongoCollection.html#find()>`__ diff --git a/source/crud/query-documents/skip.txt b/source/crud/query-documents/skip.txt index d243a9b97..2a5e8bd07 100644 --- a/source/crud/query-documents/skip.txt +++ b/source/crud/query-documents/skip.txt @@ -24,7 +24,7 @@ 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 -`FindIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.html#skip(int)>`__. +`FindIterable <{+driver-api+}/FindIterable.html#skip(int)>`__. You can use the ``skip()`` method to skip the first two documents as follows: @@ -32,7 +32,7 @@ You can use the ``skip()`` method to skip the first two documents as follows: collection.find().skip(2); -`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/crud/query-documents/sort.txt b/source/crud/query-documents/sort.txt index 3b5eb1df8..794e55c13 100644 --- a/source/crud/query-documents/sort.txt +++ b/source/crud/query-documents/sort.txt @@ -56,7 +56,7 @@ within an aggregation pipeline. 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 our 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 ``FindIterable`` instance as follows: @@ -102,11 +102,11 @@ builder class, see our For more information about the classes and interfaces in this section, see the following API Documentation: -- `FindIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/FindIterable.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>`__ +- `FindIterable <{+driver-api+}/FindIterable.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 ----------------- @@ -385,13 +385,13 @@ The output of the preceding code resembles the following: 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-sync/com/mongodb/client/MongoCollection.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+}/MongoCollection.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 about the :manual:`$text ` query operator and the :manual:`$meta ` diff --git a/source/crud/query-documents/text.txt b/source/crud/query-documents/text.txt index 5b6fb699e..747aa9f10 100644 --- a/source/crud/query-documents/text.txt +++ b/source/crud/query-documents/text.txt @@ -113,8 +113,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/crud/replace-documents.txt b/source/crud/replace-documents.txt index 9785a34c0..9f1615d60 100644 --- a/source/crud/replace-documents.txt +++ b/source/crud/replace-documents.txt @@ -25,7 +25,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-sync/com/mongodb/client/MongoCollection.html#replaceOne(org.bson.conversions.Bson,TDocument)>`__ +The `replaceOne() <{+driver-api+}/MongoCollection.html#replaceOne(org.bson.conversions.Bson,TDocument)>`__ method removes all the existing fields and values in the matching document (except the ``_id`` field) and substitutes it with the replacement document. @@ -49,7 +49,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/crud/transactions.txt b/source/crud/transactions.txt index 42a26e888..25013ecdd 100644 --- a/source/crud/transactions.txt +++ b/source/crud/transactions.txt @@ -125,6 +125,12 @@ A ``ClientSession`` also has methods to retrieve session properties and modify m session properties. View the :ref:`API documentation ` to learn more about these methods. +.. 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:`java-csot-transaction` section of the Limit Server Execution Time guide. + Example ------- @@ -174,10 +180,10 @@ 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-sync/com/mongodb/client/ClientSession.html>`_ -- `startTransaction <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/ClientSession.html#startTransaction()>`_ -- `commitTransaction <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/ClientSession.html#commitTransaction()>`_ -- `abortTransaction <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/ClientSession.html#abortTransaction()>`_ -- `withTransaction <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/ClientSession.html#withTransaction(com.mongodb.client.TransactionBody)>`_ -- `TransactionOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/TransactionOptions.html>`_ +- `ClientSession <{+driver-api+}/ClientSession.html>`_ +- `startTransaction <{+driver-api+}/ClientSession.html#startTransaction()>`_ +- `commitTransaction <{+driver-api+}/ClientSession.html#commitTransaction()>`_ +- `abortTransaction <{+driver-api+}/ClientSession.html#abortTransaction()>`_ +- `withTransaction <{+driver-api+}/ClientSession.html#withTransaction(com.mongodb.client.TransactionBody)>`_ +- `TransactionOptions <{+core-api+}/TransactionOptions.html>`_ \ No newline at end of file diff --git a/source/crud/update-documents.txt b/source/crud/update-documents.txt index 16d185fd2..923c22131 100644 --- a/source/crud/update-documents.txt +++ b/source/crud/update-documents.txt @@ -47,10 +47,10 @@ single operation, see the following pages: Update operations can modify fields and values: - The `updateOne() - <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#updateOne(org.bson.conversions.Bson,org.bson.conversions.Bson)>`__ + <{+driver-api+}/MongoCollection.html#updateOne(org.bson.conversions.Bson,org.bson.conversions.Bson)>`__ method changes the first document your query filter matches and the - `updateMany() - <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#updateMany(org.bson.conversions.Bson,org.bson.conversions.Bson)>`__ + <{+driver-api+}/MongoCollection.html#updateMany(org.bson.conversions.Bson,org.bson.conversions.Bson)>`__ method changes all the documents your query filter matches. You can call the ``updateOne()`` and ``updateMany()`` methods on a @@ -75,7 +75,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: @@ -85,7 +85,7 @@ follows: Bson update = 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. Examples @@ -215,7 +215,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-sync/com/mongodb/client/MongoCollection.html#replaceOne(org.bson.conversions.Bson,TDocument)>`__ +The `replaceOne() <{+driver-api+}/MongoCollection.html#replaceOne(org.bson.conversions.Bson,TDocument)>`__ method removes all the existing fields and values in the matching document (except the ``_id`` field) and substitutes it with the replacement document. @@ -239,7 +239,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 ~~~~~~~~~~~~~~~~~~~ @@ -330,17 +330,17 @@ API Documentation For more information about the methods and classes used on this page, see the following API documentation: -- `updateOne() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#updateOne(org.bson.conversions.Bson,java.util.List,com.mongodb.client.model.UpdateOptions)>`__ -- `updateMany() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#updateMany(org.bson.conversions.Bson,java.util.List,com.mongodb.client.model.UpdateOptions)>`__ -- `UpdateOptions <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/UpdateOptions.html>`__ -- `replaceOne() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#replaceOne(org.bson.conversions.Bson,TDocument)>`__ -- `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)>`__ -- `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)>`__ -- `currentTimestamp() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Updates.html#currentTimestamp(java.lang.String)>`__ +- `updateOne() <{+driver-api+}/MongoCollection.html#updateOne(org.bson.conversions.Bson,java.util.List,com.mongodb.client.model.UpdateOptions)>`__ +- `updateMany() <{+driver-api+}/MongoCollection.html#updateMany(org.bson.conversions.Bson,java.util.List,com.mongodb.client.model.UpdateOptions)>`__ +- `UpdateOptions <{+core-api+}/client/model/UpdateOptions.html>`__ +- `replaceOne() <{+driver-api+}/MongoCollection.html#replaceOne(org.bson.conversions.Bson,TDocument)>`__ +- `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)>`__ +- `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)>`__ +- `currentTimestamp() <{+core-api+}/client/model/Updates.html#currentTimestamp(java.lang.String)>`__ Server Manual Entries ~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/crud/update-documents/embedded-arrays.txt b/source/crud/update-documents/embedded-arrays.txt index c5f8aaf8a..4cc5ea07c 100644 --- a/source/crud/update-documents/embedded-arrays.txt +++ b/source/crud/update-documents/embedded-arrays.txt @@ -113,7 +113,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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -145,7 +145,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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -185,4 +185,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/crud/update-documents/upsert.txt b/source/crud/update-documents/upsert.txt index 3c2bfe759..85ee30677 100644 --- a/source/crud/update-documents/upsert.txt +++ b/source/crud/update-documents/upsert.txt @@ -112,5 +112,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/data-formats/codecs.txt b/source/data-formats/codecs.txt index aa479a655..0408b3235 100644 --- a/source/data-formats/codecs.txt +++ b/source/data-formats/codecs.txt @@ -136,13 +136,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: @@ -190,8 +190,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: @@ -260,8 +260,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 @@ -317,7 +317,7 @@ This code outputs the following: Java type: java.util.Set For a complete list of the default mappings, see 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: @@ -401,7 +401,7 @@ If you run the preceding example, you should see the following output: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `withCodecRegistry() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#withCodecRegistry(org.bson.codecs.configuration.CodecRegistry)>`__ -- `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+}/MongoCollection.html#withCodecRegistry(org.bson.codecs.configuration.CodecRegistry)>`__ +- `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/data-formats/document-data-format-bson.txt b/source/data-formats/document-data-format-bson.txt index b69a8e534..6572c5ed6 100644 --- a/source/data-formats/document-data-format-bson.txt +++ b/source/data-formats/document-data-format-bson.txt @@ -38,14 +38,14 @@ MongoDB and BSON The MongoDB Java 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) -- `BasicDBObject <{+api+}/apidocs/mongodb-driver-core/com/mongodb/BasicDBObject.html>`__ (Java Driver 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) +- `BasicDBObject <{+core-api+}/BasicDBObject.html>`__ (Java Driver package) For more information about using these object types, see our :ref:`Documents guide `. diff --git a/source/data-formats/document-data-format-extended-json.txt b/source/data-formats/document-data-format-extended-json.txt index ae718e114..6720c5f3d 100644 --- a/source/data-formats/document-data-format-extended-json.txt +++ b/source/data-formats/document-data-format-extended-json.txt @@ -86,7 +86,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 @@ -226,7 +226,7 @@ an Extended JSON string into Java objects: 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 ------------------- @@ -296,9 +296,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 --------------------------- @@ -346,5 +346,5 @@ Without specifying the converters, the Relaxed mode JSON output resembles the fo 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>`__ +- `Converter <{+api-root+}/bson/org/bson/json/Converter.html>`__ +- `JsonWriterSettings.Builder <{+api-root+}/bson/org/bson/json/JsonWriterSettings.Builder.html>`__ diff --git a/source/data-formats/document-data-format-pojo.txt b/source/data-formats/document-data-format-pojo.txt index b8796e1fa..5775bedd4 100644 --- a/source/data-formats/document-data-format-pojo.txt +++ b/source/data-formats/document-data-format-pojo.txt @@ -197,14 +197,14 @@ The example prints the following output: For more information about the methods and classes mentioned in this section, see the following API documentation: -- `CodecRegistry <{+api+}/apidocs/bson/org/bson/codecs/configuration/CodecRegistry.html>`__ -- `TDocument <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html>`__ -- `PojoCodecProvider <{+api+}/apidocs/bson/org/bson/codecs/pojo/PojoCodecProvider.html>`__ -- `automatic(true) <{+api+}/apidocs/bson/org/bson/codecs/pojo/PojoCodecProvider.Builder.html#automatic(boolean)>`__ -- `PojoCodecProvider.Builder <{+api+}/apidocs/bson/org/bson/codecs/pojo/PojoCodecProvider.Builder.html>`__ -- `fromRegistries() <{+api+}/apidocs/bson/org/bson/codecs/configuration/CodecRegistries.html#fromRegistries(org.bson.codecs.configuration.CodecRegistry...)>`__ -- `getDefaultCodecRegistry() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html?is-external=true#getDefaultCodecRegistry()>`__ -- `fromProviders() <{+api+}/apidocs/bson/org/bson/codecs/configuration/CodecRegistries.html#fromProviders(org.bson.codecs.configuration.CodecProvider...)>`__ +- `CodecRegistry <{+api-root+}/bson/org/bson/codecs/configuration/CodecRegistry.html>`__ +- `TDocument <{+driver-api+}/MongoCollection.html>`__ +- `PojoCodecProvider <{+api-root+}/bson/org/bson/codecs/pojo/PojoCodecProvider.html>`__ +- `automatic(true) <{+api-root+}/bson/org/bson/codecs/pojo/PojoCodecProvider.Builder.html#automatic(boolean)>`__ +- `PojoCodecProvider.Builder <{+api-root+}/bson/org/bson/codecs/pojo/PojoCodecProvider.Builder.html>`__ +- `fromRegistries() <{+api-root+}/bson/org/bson/codecs/configuration/CodecRegistries.html#fromRegistries(org.bson.codecs.configuration.CodecRegistry...)>`__ +- `getDefaultCodecRegistry() <{+core-api+}/MongoClientSettings.html?is-external=true#getDefaultCodecRegistry()>`__ +- `fromProviders() <{+api-root+}/bson/org/bson/codecs/configuration/CodecRegistries.html#fromProviders(org.bson.codecs.configuration.CodecProvider...)>`__ Frequently Asked Questions -------------------------- diff --git a/source/data-formats/document-data-format-record.txt b/source/data-formats/document-data-format-record.txt index d5401f292..6e522dab3 100644 --- a/source/data-formats/document-data-format-record.txt +++ b/source/data-formats/document-data-format-record.txt @@ -108,7 +108,7 @@ Specify Component Conversion Using Annotations This section describes how to configure the serialization behavior of record components by using annotations. For a full list of supported annotations, see the `org.bson.codecs.pojo.annotations package API documentation. -<{+api+}/apidocs/bson/org/bson/codecs/pojo/annotations/package-summary.html>`__ +<{+api-root+}/bson/org/bson/codecs/pojo/annotations/package-summary.html>`__ .. note:: @@ -179,7 +179,7 @@ as shown in the following code: The ``org.bson.codecs.records.annotations`` package is deprecated. Use the equivalent annotations from the `org.bson.codecs.pojo.annotations - <{+api+}/apidocs/bson/org/bson/codecs/pojo/annotations/package-summary.html>`__ package + <{+api-root+}/bson/org/bson/codecs/pojo/annotations/package-summary.html>`__ package instead. Operations with Recursive Types @@ -233,4 +233,4 @@ see :ref:`Codecs `. You can't create a record codec directly, but you can use the ``RecordCodecProvider`` to implement the record codec in your code. Learn more about the ``RecordCodecProvider``, see the -`API documentation <{+api+}/apidocs/bson-record-codec/org/bson/codecs/record/RecordCodecProvider.html>`__. +`API documentation <{+api-root+}/bson-record-codec/org/bson/codecs/record/RecordCodecProvider.html>`__. diff --git a/source/data-formats/documents.txt b/source/data-formats/documents.txt index a16405e74..c1f5e3cd9 100644 --- a/source/data-formats/documents.txt +++ b/source/data-formats/documents.txt @@ -182,9 +182,9 @@ For more information about 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-sync/com/mongodb/client/MongoDatabase.html#getCollection(java.lang.String)>`__ -- `get() <{+api+}/apidocs/bson/org/bson/Document.html#get(java.lang.Object)>`__ +- `Document <{+api-root+}/bson/org/bson/Document.html>`__ +- `getCollection() <{+driver-api+}/MongoDatabase.html#getCollection(java.lang.String)>`__ +- `get() <{+api-root+}/bson/org/bson/Document.html#get(java.lang.Object)>`__ BsonDocument ------------ @@ -300,11 +300,11 @@ The output of the preceding code resembles the following: 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-sync/com/mongodb/client/MongoDatabase.html#getCollection(java.lang.String)>`__ -- `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+}/MongoDatabase.html#getCollection(java.lang.String)>`__ +- `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 ---------- @@ -430,10 +430,10 @@ The output of the preceding code resembles the following: 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-sync/com/mongodb/client/MongoDatabase.html#getCollection(java.lang.String,java.lang.Class)>`__ +- `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+}/MongoDatabase.html#getCollection(java.lang.String,java.lang.Class)>`__ BasicDBObject ------------- @@ -528,9 +528,9 @@ The output of the preceding code resembles the following: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `BasicDBObject <{+api+}/apidocs/mongodb-driver-core/com/mongodb/BasicDBObject.html>`__ -- `getCollection() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#getCollection(java.lang.String,java.lang.Class)>`__ -- `get() <{+api+}/apidocs/bson/org/bson/BasicBSONObject.html?is-external=true#get(java.lang.String)>`__ +- `BasicDBObject <{+core-api+}/BasicDBObject.html>`__ +- `getCollection() <{+driver-api+}/MongoDatabase.html#getCollection(java.lang.String,java.lang.Class)>`__ +- `get() <{+api-root+}/bson/org/bson/BasicBSONObject.html?is-external=true#get(java.lang.String)>`__ Summary ------- diff --git a/source/data-formats/pojo-customization.txt b/source/data-formats/pojo-customization.txt index 1cf4203d8..0f6f0529f 100644 --- a/source/data-formats/pojo-customization.txt +++ b/source/data-formats/pojo-customization.txt @@ -82,7 +82,7 @@ The following example shows how you can specify the POJOs in a package named // Call withCodecRegistry(pojoCodecRegistry) on an instance of MongoClient, MongoDatabase, or MongoCollection -For more information about this class, see the `PojoCodecProvider.Builder <{+api+}/apidocs/bson/org/bson/codecs/pojo/PojoCodecProvider.Builder.html>`__ +For more information about this class, see the `PojoCodecProvider.Builder <{+api-root+}/bson/org/bson/codecs/pojo/PojoCodecProvider.Builder.html>`__ API Documentation. .. _classmodel: @@ -130,7 +130,7 @@ A ``ClassModel`` contains the following fields: * - Discriminator Flag - Specifies whether to serialize the discriminator, off by default. Optional. -For more information about this class, see the `ClassModel <{+api+}/apidocs/bson/org/bson/codecs/pojo/ClassModel.html>`__ +For more information about this class, see the `ClassModel <{+api-root+}/bson/org/bson/codecs/pojo/ClassModel.html>`__ API Documentation. To instantiate a ``ClassModel``, use the ``ClassModel.builder()`` method and @@ -191,7 +191,7 @@ To create a ``PropertyModel`` use a ``PropertyModelBuilder`` which you can instantiate by calling the ``PropertyModel.builder()`` method. For more information about this class, see the -`PropertyModel.Builder <{+api+}/apidocs/bson/org/bson/codecs/pojo/PropertyModelBuilder.html>`__ API Documentation. +`PropertyModel.Builder <{+api-root+}/bson/org/bson/codecs/pojo/PropertyModelBuilder.html>`__ API Documentation. .. _conventions: @@ -253,8 +253,8 @@ from the following static fields in the ``Conventions`` class: You can specify Conventions using one of the following methods: -- `PojoCodecProvider.Builder.conventions() <{+api+}/apidocs/bson/org/bson/codecs/pojo/PojoCodecProvider.Builder.html>`__ -- `ClassModelBuilder.conventions() <{+api+}/apidocs/bson/org/bson/codecs/pojo/ClassModelBuilder.html#conventions(java.util.List)>`__ +- `PojoCodecProvider.Builder.conventions() <{+api-root+}/bson/org/bson/codecs/pojo/PojoCodecProvider.Builder.html>`__ +- `ClassModelBuilder.conventions() <{+api-root+}/bson/org/bson/codecs/pojo/ClassModelBuilder.html#conventions(java.util.List)>`__ To create a custom Convention, create a class that implements the ``Convention`` interface and override the ``apply()`` method from which you can @@ -270,7 +270,7 @@ class. These annotations configure the ``ClassModel`` and ``PropertyModel`` behavior for a specific field, method, or class. The following annotations are available from the -`org.bson.codecs.pojo.annotations <{+api+}/apidocs/bson/org/bson/codecs/pojo/annotations/package-summary.html>`__ +`org.bson.codecs.pojo.annotations <{+api-root+}/bson/org/bson/codecs/pojo/annotations/package-summary.html>`__ package: .. list-table:: @@ -315,8 +315,8 @@ package: - | Specifies the POJO field on which to deserialize all elements that are not mapped to a field. The POJO field must be one of the following types: - | - `Document <{+api+}/apidocs/bson/org/bson/Document.html>`__ - | - `BsonDocument <{+api+}/apidocs/bson/org/bson/BsonDocument.html>`__ + | - `Document <{+api-root+}/bson/org/bson/Document.html>`__ + | - `BsonDocument <{+api-root+}/bson/org/bson/BsonDocument.html>`__ | - ``Map`` | | See the :ref:`BsonExtraElements Annotation Example ` on this page. @@ -751,8 +751,8 @@ and the package that contains your POJO as follows: For more information about the methods and classes mentioned in this section, see the following API Documentation: -- `PropertyCodecProvider <{+api+}/apidocs/bson/org/bson/codecs/pojo/PropertyCodecProvider.html>`__ -- `TypeWithTypeParameters <{+api+}/apidocs/bson/org/bson/codecs/pojo/TypeWithTypeParameters.html>`__ +- `PropertyCodecProvider <{+api-root+}/bson/org/bson/codecs/pojo/PropertyCodecProvider.html>`__ +- `TypeWithTypeParameters <{+api-root+}/bson/org/bson/codecs/pojo/TypeWithTypeParameters.html>`__ For more information about generics and type parameters, see the `Java language guide on Invoking and Instantiating a Generic Type `__. diff --git a/source/data-formats/time-series.txt b/source/data-formats/time-series.txt index c46279be2..4e51b92fe 100644 --- a/source/data-formats/time-series.txt +++ b/source/data-formats/time-series.txt @@ -42,11 +42,11 @@ Create a Time Series Collection ------------------------------- To create a time series collection, pass the following parameters to the -`createCollection() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#createCollection(java.lang.String,com.mongodb.client.model.CreateCollectionOptions)>`__ +`createCollection() <{+driver-api+}/MongoDatabase.html#createCollection(java.lang.String,com.mongodb.client.model.CreateCollectionOptions)>`__ 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:: /includes/fundamentals/code-snippets/TimeSeries.java :start-after: begin time series @@ -60,7 +60,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-sync/com/mongodb/client/MongoDatabase.html#runCommand(org.bson.conversions.Bson)>`__ method. +``"listCollections"`` command to the `runCommand() <{+driver-api+}/MongoDatabase.html#runCommand(org.bson.conversions.Bson)>`__ method. .. literalinclude:: /includes/fundamentals/code-snippets/TimeSeries.java :start-after: begin check collection type diff --git a/source/databases-collections.txt b/source/databases-collections.txt index cee793148..e286d4074 100644 --- a/source/databases-collections.txt +++ b/source/databases-collections.txt @@ -4,8 +4,6 @@ Databases and Collections ========================= - - .. contents:: On this page :local: :backlinks: none @@ -38,7 +36,7 @@ Access a Database ----------------- Use the `getDatabase() -<{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html#getDatabase(java.lang.String)>`__ method of +<{+driver-api+}/MongoClient.html#getDatabase(java.lang.String)>`__ method of a ``MongoClient`` instance to access a ``MongoDatabase`` in a MongoDB instance. @@ -52,7 +50,7 @@ Access a Collection ------------------- Use the `getCollection() -<{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#getCollection(java.lang.String)>`__ +<{+driver-api+}/MongoDatabase.html#getCollection(java.lang.String)>`__ method of a ``MongoDatabase`` instance to access a ``MongoCollection`` in a database of your connected MongoDB instance. @@ -74,7 +72,7 @@ Create a Collection ------------------- Use the `createCollection() -<{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#createCollection(java.lang.String,com.mongodb.client.model.CreateCollectionOptions)>`__ +<{+driver-api+}/MongoDatabase.html#createCollection(java.lang.String,com.mongodb.client.model.CreateCollectionOptions)>`__ method of a ``MongoDatabase`` instance to create a collection in a database of your connected MongoDB instance. @@ -87,7 +85,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. @@ -97,9 +95,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>`__ +<{+core-api+}/client/model/Filters.html>`__ that specifies the validation rules and expressions: .. code-block:: java @@ -119,7 +117,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-sync/com/mongodb/client/MongoDatabase.html#listCollectionNames()>`__ method: +<{+driver-api+}/MongoDatabase.html#listCollectionNames()>`__ method: .. code-block:: java @@ -132,7 +130,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: +<{+driver-api+}/MongoCollection.html#drop()>`__ method: .. code-block:: java @@ -165,17 +163,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-sync/com/mongodb/client/MongoDatabase.html#withReadConcern(com.mongodb.ReadConcern)>`__ +- `MongoDatabase.withReadConcern() <{+driver-api+}/MongoDatabase.html#withReadConcern(com.mongodb.ReadConcern)>`__ -- `MongoDatabase.withReadPreference() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#withReadPreference(com.mongodb.ReadPreference)>`__ +- `MongoDatabase.withReadPreference() <{+driver-api+}/MongoDatabase.html#withReadPreference(com.mongodb.ReadPreference)>`__ -- `MongoDatabase.withWriteConcern() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#withWriteConcern(com.mongodb.WriteConcern)>`__ +- `MongoDatabase.withWriteConcern() <{+driver-api+}/MongoDatabase.html#withWriteConcern(com.mongodb.WriteConcern)>`__ -- `MongoCollection.withReadConcern() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#withReadConcern(com.mongodb.ReadConcern)>`__ +- `MongoCollection.withReadConcern() <{+driver-api+}/MongoCollection.html#withReadConcern(com.mongodb.ReadConcern)>`__ -- `MongoCollection.withReadPreference() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#withReadPreference(com.mongodb.ReadPreference)>`__ +- `MongoCollection.withReadPreference() <{+driver-api+}/MongoCollection.html#withReadPreference(com.mongodb.ReadPreference)>`__ -- `MongoCollection.withWriteConcern() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#withWriteConcern(com.mongodb.WriteConcern)>`__ +- `MongoCollection.withWriteConcern() <{+driver-api+}/MongoCollection.html#withWriteConcern(com.mongodb.WriteConcern)>`__ .. tip:: diff --git a/source/get-started.txt b/source/get-started.txt index 0a2a07058..941d04ff7 100644 --- a/source/get-started.txt +++ b/source/get-started.txt @@ -70,10 +70,19 @@ its dependencies in your development environment. or `Creating New Gradle Builds `__ to learn how to set up your project. + .. step:: Add the {+driver-short+} Bill of Materials + + .. _java-get-started-install-bom: + + .. sharedinclude:: dbx/jvm/bom.rst + + .. replacement:: gradle-filename + + ``build.gradle`` + .. step:: Install the {+driver-short+} - In your IDE, create a new `Maven `__ or `Gradle `__ - project. If you use Maven, add the following code to your ``pom.xml`` dependencies list: + If you use Maven, add the following code to your ``pom.xml`` dependencies list: .. code-block:: xml @@ -81,7 +90,6 @@ its dependencies in your development environment. org.mongodb mongodb-driver-sync - {+full-version+} @@ -90,13 +98,17 @@ its dependencies in your development environment. .. code-block:: groovy dependencies { - implementation 'org.mongodb:mongodb-driver-sync:{+full-version+}' + implementation 'org.mongodb:mongodb-driver-sync' } + 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 they are available to your project by running your dependency manager and refreshing the project in your IDE. - + After you complete these steps, you have a new project and the driver dependencies installed. @@ -247,4 +259,4 @@ visiting the following guides: - :ref:`java-db-coll`: Learn more about interacting with MongoDB databases and collections. - :ref:`java-integrations`: Learn about the third-party - integrations that you can use with the {+driver-short+}. \ No newline at end of file + integrations that you can use with the {+driver-short+}. diff --git a/source/includes/connect/CsotExample.java b/source/includes/connect/CsotExample.java new file mode 100644 index 000000000..40deca853 --- /dev/null +++ b/source/includes/connect/CsotExample.java @@ -0,0 +1,154 @@ +package org.example; + +import static com.mongodb.client.model.Filters.gte; +import static java.util.concurrent.TimeUnit.MILLISECONDS; + +import com.mongodb.ClientSessionOptions; +import com.mongodb.ConnectionString; +import com.mongodb.MongoClientSettings; +import com.mongodb.TransactionOptions; +import com.mongodb.client.*; +import com.mongodb.client.cursor.TimeoutMode; +import org.bson.Document; + + +public class CsotExample { + + public static void main(String[] args) { + MongoClient mongoClient = new CsotExample().mongoClientSettings(); + } + + private MongoClient mongoClientSettings(){ + // start-mongoclientsettings + MongoClientSettings settings = MongoClientSettings.builder() + .applyConnectionString(new ConnectionString("")) + .timeout(200L, MILLISECONDS) + .build(); + + MongoClient mongoClient = MongoClients.create(settings); + // end-mongoclientsettings + + return mongoClient; + } + + private MongoClient connectionString(){ + // start-string + String uri = "/?timeoutMS=200"; + MongoClient mongoClient = MongoClients.create(uri); + // end-string + + return mongoClient; + } + + private void operationTimeout(){ + // start-operation-timeout + MongoClientSettings settings = MongoClientSettings.builder() + .applyConnectionString(new ConnectionString("")) + .timeout(200L, MILLISECONDS) + .build(); + + try (MongoClient mongoClient = MongoClients.create(settings)) { + MongoDatabase database = mongoClient.getDatabase("db"); + MongoCollection collection = database.getCollection("people"); + + collection.insertOne(new Document("name", "Francine Loews")); + } + // end-operation-timeout + } + + private void overrideTimeout(){ + // start-override + MongoClientSettings settings = MongoClientSettings.builder() + .applyConnectionString(new ConnectionString("")) + .timeout(200L, MILLISECONDS) + .build(); + + try (MongoClient mongoClient = MongoClients.create(settings)) { + MongoDatabase database = mongoClient.getDatabase("db"); + MongoCollection collection = database + .getCollection("people") + .withTimeout(300L, MILLISECONDS); + + // ... perform operations on MongoCollection + } + // end-override + } + + private void transactionTimeout(){ + MongoClientSettings settings = MongoClientSettings.builder() + .applyConnectionString(new ConnectionString("")) + .build(); + + try (MongoClient mongoClient = MongoClients.create(settings)) { + MongoCollection collection = mongoClient + .getDatabase("db") + .getCollection("people"); + + // start-session-timeout + ClientSessionOptions opts = ClientSessionOptions.builder() + .defaultTimeout(200L, MILLISECONDS) + .build(); + + ClientSession session = mongoClient.startSession(opts); + // ... perform operations on ClientSession + // end-session-timeout + + // start-transaction-timeout + TransactionOptions transactionOptions = TransactionOptions.builder() + .timeout(200L, MILLISECONDS) + .build(); + // end-transaction-timeout + } + + } + + private void cursorTimeout(){ + MongoClientSettings settings = MongoClientSettings.builder() + .applyConnectionString(new ConnectionString("")) + .timeout(200L, MILLISECONDS) + .build(); + + try (MongoClient mongoClient = MongoClients.create(settings)) { + MongoCollection collection = mongoClient + .getDatabase("db") + .getCollection("people"); + + // start-cursor-lifetime + FindIterable cursorWithLifetimeTimeout = collection + .find(gte("age", 40)) + .timeoutMode(TimeoutMode.CURSOR_LIFETIME); + // end-cursor-lifetime + + // start-cursor-iteration + try (MongoCursor cursorWithIterationTimeout = collection + .find(gte("age", 40)) + .timeoutMode(TimeoutMode.ITERATION) + .cursor() + ) { + while (cursorWithIterationTimeout.hasNext()) { + System.out.println(cursorWithIterationTimeout.next().toJson()); + } + } + // end-cursor-iteration + } + + } + + private void gridFSTimeout(){ + MongoClientSettings settings = MongoClientSettings.builder() + .applyConnectionString(new ConnectionString("")) + .build(); + + try (MongoClient mongoClient = MongoClients.create(settings)) { + MongoDatabase database = mongoClient.getDatabase("db"); + + // start-gridfsbucket-timeout + GridFSBucket gridFSBucket = GridFSBuckets + .create(database) + .withTimeout(200L, MILLISECONDS); + // end-gridfsbucket-timeout + } + + } + +} diff --git a/source/includes/fundamentals/auth-specify.rst b/source/includes/fundamentals/auth-specify.rst index 135d91ed0..d99068823 100644 --- a/source/includes/fundamentals/auth-specify.rst +++ b/source/includes/fundamentals/auth-specify.rst @@ -24,7 +24,7 @@ connection settings when constructing your ``MongoClient``. Select the For more information about these classes and methods, see the following API documentation: -- `MongoClients.create() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClients.html#create()>`__ -- `MongoClient <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html>`__ -- `MongoClientSettings.Builder <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html>`__ -- `MongoCredential <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html>`__ +- `MongoClients.create() <{+driver-api+}/MongoClients.html#create()>`__ +- `MongoClient <{+driver-api+}/MongoClient.html>`__ +- `MongoClientSettings.Builder <{+core-api+}/MongoClientSettings.Builder.html>`__ +- `MongoCredential <{+core-api+}/MongoCredential.html>`__ diff --git a/source/includes/fundamentals/code-snippets/CompoundOperatorsIndividualExamples.java b/source/includes/fundamentals/code-snippets/CompoundOperatorsIndividualExamples.java index 3102c5120..f2a95c5ec 100644 --- a/source/includes/fundamentals/code-snippets/CompoundOperatorsIndividualExamples.java +++ b/source/includes/fundamentals/code-snippets/CompoundOperatorsIndividualExamples.java @@ -66,11 +66,10 @@ private void findOneAndUpdateExample() { // Creates an update document to set the value of "food" to "pizza" Bson update = Updates.set("food", "pizza"); - // Defines options that specify projected fields, permit an upsert and limit execution time - FindOneAndUpdateOptions options = new FindOneAndUpdateOptions(). - projection(projection). - upsert(true). - maxTime(5, TimeUnit.SECONDS); + // Defines options that specify projected fields and permit upserts + FindOneAndUpdateOptions options = new FindOneAndUpdateOptions() + .projection(projection) + .upsert(true); // Updates the first matching document with the content of the update document, applying the specified options Document result = collection.findOneAndUpdate(filter, update, options); diff --git a/source/includes/fundamentals/code-snippets/Transaction.java b/source/includes/fundamentals/code-snippets/Transaction.java index 1756b41dd..0cd75b0da 100644 --- a/source/includes/fundamentals/code-snippets/Transaction.java +++ b/source/includes/fundamentals/code-snippets/Transaction.java @@ -18,7 +18,7 @@ public static void main(String[] args) { MongoCollection collection = database.getCollection("books"); // Sets transaction options - TransactionOptions txnOptions = TransactionOptions.builder() + TransactionOptions transactionOptions = TransactionOptions.builder() .writeConcern(WriteConcern.MAJORITY) .build(); @@ -32,7 +32,7 @@ public static void main(String[] args) { new Document("title", "Song of Solomon").append("author", "Toni Morrison") )); return null; // Return value as expected by the lambda - }, txnOptions); + }, transactionOptions); } } catch (Exception e) { e.printStackTrace(); diff --git a/source/includes/fundamentals/code-snippets/auth-credentials-gssapi-properties.rst b/source/includes/fundamentals/code-snippets/auth-credentials-gssapi-properties.rst index f4ec395ce..44fa2e0de 100644 --- a/source/includes/fundamentals/code-snippets/auth-credentials-gssapi-properties.rst +++ b/source/includes/fundamentals/code-snippets/auth-credentials-gssapi-properties.rst @@ -1,5 +1,5 @@ .. code-block:: java - MongoCredential credential = MongoCredential.createGSSAPICredential(); + MongoCredential credential = MongoCredential.createGSSAPICredential(); credential = credential.withMechanismProperty(MongoCredential.SERVICE_NAME_KEY, "myService"); diff --git a/source/includes/fundamentals/code-snippets/auth-credentials-gssapi-subject-key.rst b/source/includes/fundamentals/code-snippets/auth-credentials-gssapi-subject-key.rst index a5c1da73c..bb8dac028 100644 --- a/source/includes/fundamentals/code-snippets/auth-credentials-gssapi-subject-key.rst +++ b/source/includes/fundamentals/code-snippets/auth-credentials-gssapi-subject-key.rst @@ -4,6 +4,6 @@ loginContext.login(); Subject subject = loginContext.getSubject(); - MongoCredential credential = MongoCredential.createGSSAPICredential(); + MongoCredential credential = MongoCredential.createGSSAPICredential(); credential = credential.withMechanismProperty(MongoCredential.JAVA_SUBJECT_KEY, subject); diff --git a/source/includes/fundamentals/code-snippets/auth-credentials-gssapi-ticket-cache.rst b/source/includes/fundamentals/code-snippets/auth-credentials-gssapi-ticket-cache.rst index b446e3987..7070930ed 100644 --- a/source/includes/fundamentals/code-snippets/auth-credentials-gssapi-ticket-cache.rst +++ b/source/includes/fundamentals/code-snippets/auth-credentials-gssapi-ticket-cache.rst @@ -3,7 +3,7 @@ /* all MongoClient instances sharing this instance of KerberosSubjectProvider will share a Kerberos ticket cache */ String myLoginContext = "myContext"; - MongoCredential credential = MongoCredential.createGSSAPICredential(); + MongoCredential credential = MongoCredential.createGSSAPICredential(); /* login context defaults to "com.sun.security.jgss.krb5.initiate" if unspecified in KerberosSubjectProvider */ credential = credential.withMechanismProperty(MongoCredential.JAVA_SUBJECT_PROVIDER_KEY, diff --git a/source/includes/fundamentals/code-snippets/auth-credentials-gssapi.rst b/source/includes/fundamentals/code-snippets/auth-credentials-gssapi.rst index 5f76050a4..0cb0795f9 100644 --- a/source/includes/fundamentals/code-snippets/auth-credentials-gssapi.rst +++ b/source/includes/fundamentals/code-snippets/auth-credentials-gssapi.rst @@ -1,6 +1,6 @@ .. code-block:: java - MongoCredential credential = MongoCredential.createGSSAPICredential(); + MongoCredential credential = MongoCredential.createGSSAPICredential(); MongoClient mongoClient = MongoClients.create( MongoClientSettings.builder() diff --git a/source/includes/fundamentals/code-snippets/auth-credentials-ldap.rst b/source/includes/fundamentals/code-snippets/auth-credentials-ldap.rst index d539843dc..a2b19de44 100644 --- a/source/includes/fundamentals/code-snippets/auth-credentials-ldap.rst +++ b/source/includes/fundamentals/code-snippets/auth-credentials-ldap.rst @@ -1,6 +1,6 @@ .. code-block:: java - MongoCredential credential = MongoCredential.createPlainCredential(, "$external", ); + MongoCredential credential = MongoCredential.createPlainCredential(, "$external", ); MongoClient mongoClient = MongoClients.create( MongoClientSettings.builder() diff --git a/source/includes/fundamentals/code-snippets/builders/AggregateSearchBuilderExample.java b/source/includes/fundamentals/code-snippets/builders/AggregateSearchBuilderExample.java index 593507042..c39a09230 100644 --- a/source/includes/fundamentals/code-snippets/builders/AggregateSearchBuilderExample.java +++ b/source/includes/fundamentals/code-snippets/builders/AggregateSearchBuilderExample.java @@ -1,6 +1,5 @@ -package fundamentals.builders; +package org.example; -import java.util.Arrays; import java.util.List; import org.bson.Document; @@ -14,7 +13,8 @@ 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; +import static com.mongodb.client.model.search.SearchPath.fieldPath; + public class AggregateSearchBuilderExample { private static final String CONNECTION_URI = ""; @@ -24,14 +24,14 @@ private static void runMatch(MongoCollection collection) { Bson matchStage = Aggregates.match(Filters.eq("title", "Future")); Bson projection = Aggregates.project(Projections.fields(Projections.include("title", "released"))); - List aggregateStages = Arrays.asList(matchStage, projection); + List aggregateStages = List.of(matchStage, projection); System.out.println("aggregateStages: " + aggregateStages); collection.aggregate( aggregateStages - ).forEach(result -> System.out.println(result)); + ).forEach(result -> System.out.println(result)); } - /* + /* * Atlas text search aggregation * Requires Atlas cluster and full text search index * See https://www.mongodb.com/docs/atlas/atlas-search/tutorial/ for more info on requirements @@ -40,13 +40,65 @@ private static void runAtlasTextSearch(MongoCollection collection) { // begin atlasTextSearch Bson textSearch = Aggregates.search( SearchOperator.text( - SearchPath.fieldPath("title"), "Future")); + fieldPath("title"), "Future")); // end atlasTextSearch // To condense result data, add this projection into the pipeline // Bson projection = Aggregates.project(Projections.fields(Projections.include("title", "released"))); - List aggregateStages = Arrays.asList(textSearch); + List aggregateStages = List.of(textSearch); + System.out.println("aggregateStages: " + aggregateStages); + + System.out.println("explain:\n" + collection.aggregate(aggregateStages).explain()); + collection.aggregate(aggregateStages).forEach(result -> System.out.println(result)); + } + + /* + * Atlas search aggregation + * Requires Atlas cluster and full text search index + * See https://www.mongodb.com/docs/atlas/atlas-search/tutorial/ for more info on requirements + */ + private static void runAtlasSearchWithSearchHelperMethods(MongoCollection collection) { + // begin atlasHelperMethods + List pipeline = new ArrayList<>(); + + pipeline.add(Aggregates.search( + SearchOperator.compound() + .filter( + List.of( + SearchOperator.in(fieldPath("genres"), "Comedy"), + SearchOperator.phrase(fieldPath("fullplot"), "new york"), + SearchOperator.numberRange(fieldPath("year")).gtLt(1950, 2000), + SearchOperator.wildcard(fieldPath("title"), "Love *") + )))); + + pipeline.add(Aggregates.project( + Projections.include("title", "year", "genres") + )); + + AggregateIterable results = collection.aggregate(pipeline); + results.forEach(doc -> System.out.println(doc.toJson())); + // end atlasHelperMethods + } + + /* + * Atlas search aggregation + * Requires Atlas cluster and full text search index + * See https://www.mongodb.com/docs/atlas/atlas-search/tutorial/ for more info on requirements + */ + private static void runAtlasSearch(MongoCollection collection) { + // begin atlasSearch + Bson search_stage = Aggregates.search( + SearchOperator.compound() + .filter(List.of(SearchOperator.text(fieldPath("genres"), "Drama"))) + .must(List.of(SearchOperator.phrase(fieldPath("cast"), "keanu reeves"))) + ); + // end atlasSearch + + // To condense result data, add this projection into the pipeline + // Bson projection = Aggregates.project(Projections.fields(Projections.include("title", "released"))); + + List aggregateStages = List.of(search_stage); System.out.println("aggregateStages: " + aggregateStages); System.out.println("explain:\n" + collection.aggregate(aggregateStages).explain()); @@ -55,12 +107,12 @@ private static void runAtlasTextSearch(MongoCollection collection) { private static void runAtlasTextSearchMeta(MongoCollection collection) { Bson textSearchMeta = - // begin atlasSearchMeta - Aggregates.searchMeta( - SearchOperator.near(2010, 1, SearchPath.fieldPath("year"))); + // begin atlasSearchMeta + Aggregates.searchMeta( + SearchOperator.near(2010, 1, fieldPath("year"))); // end atlasSearchMeta - List aggregateStages = Arrays.asList(textSearchMeta); + List aggregateStages = List.of(textSearchMeta); System.out.println("aggregateStages: " + aggregateStages); collection.aggregate(aggregateStages).forEach(result -> System.out.println(result)); @@ -77,7 +129,9 @@ public static void main(String[] args) { // Uncomment the methods that correspond to what you're testing // runMatch(collection); // runAtlasTextSearch(collection); - runAtlasTextSearchMeta(collection); + // runAtlasSearch(collection); + // runAtlasTextSearchMeta(collection); + // runAtlasSearchWithSearchHelperMethods(collection); } } } diff --git a/source/index.txt b/source/index.txt index 74724e476..a4c9dfaa1 100644 --- a/source/index.txt +++ b/source/index.txt @@ -63,11 +63,11 @@ Get Started Learn how to establish a connection to MongoDB Atlas and begin working with data in the :ref:`Get Started ` section. -What's New ----------- +Release Notes +------------- For a list of new features and changes in each version, see the -:ref:`What's New ` section. +:ref:`Release Notes ` section. API Documentation ----------------- @@ -85,19 +85,19 @@ 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 - * - `Java Driver <{+api+}/apidocs/mongodb-driver-sync/index.html>`__ + * - `Java Driver <{+api-root+}/mongodb-driver-sync/index.html>`__ - Modern API - * - `Legacy Java Driver <{+api+}/apidocs/mongodb-driver-legacy/index.html>`__ + * - `Legacy Java Driver <{+api-root+}/mongodb-driver-legacy/index.html>`__ - Legacy API Connection Troubleshooting diff --git a/source/indexes.txt b/source/indexes.txt index e38d9d7b0..7401dce4e 100644 --- a/source/indexes.txt +++ b/source/indexes.txt @@ -94,11 +94,11 @@ most common index types and provide sample code for creating each index type. Fo .. tip:: - The MongoDB Java Driver provides the `Indexes <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Indexes.html>`__ class that + The MongoDB Java Driver provides the `Indexes <{+core-api+}/client/model/Indexes.html>`__ class that 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-sync/com/mongodb/client/MongoCollection.html#createIndex(org.bson.conversions.Bson,com.mongodb.client.model.IndexOptions)>`__ +`createIndex() <{+driver-api+}/MongoCollection.html#createIndex(org.bson.conversions.Bson,com.mongodb.client.model.IndexOptions)>`__ method to create various indexes, and the following setup: .. literalinclude:: /includes/fundamentals/code-snippets/IndexPage.java @@ -245,7 +245,7 @@ Create a Search Index +++++++++++++++++++++ You can use the `createSearchIndex() -<{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#createSearchIndex(org.bson.conversions.Bson)>`__ +<{+driver-api+}/MongoCollection.html#createSearchIndex(org.bson.conversions.Bson)>`__ method to create an Atlas Search index. You *cannot* use this method to create a Vector Search index. @@ -258,11 +258,11 @@ The following code example shows how to create an Atlas Search index: :end-before: end create-search-index You can use the -`createSearchIndexes() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#createSearchIndexes(java.util.List)>`__ +`createSearchIndexes() <{+driver-api+}/MongoCollection.html#createSearchIndexes(java.util.List)>`__ method to create multiple Atlas Search indexes or one or more Vector Search indexes. You must create and pass 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 @@ -278,7 +278,7 @@ List Search Indexes +++++++++++++++++++ You can use the -`listSearchIndexes() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#listSearchIndexes()>`__ +`listSearchIndexes() <{+driver-api+}/MongoCollection.html#listSearchIndexes()>`__ method to return the Atlas Search indexes of a collection. The following code example shows how to print a list of the search indexes of @@ -294,7 +294,7 @@ Update a Search Index +++++++++++++++++++++ You can use the -`updateSearchIndex() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#updateSearchIndex(java.lang.String,org.bson.conversions.Bson)>`__ +`updateSearchIndex() <{+driver-api+}/MongoCollection.html#updateSearchIndex(java.lang.String,org.bson.conversions.Bson)>`__ method to update an Atlas Search index. The following code shows how to update a search index: @@ -309,7 +309,7 @@ Drop a Search Index +++++++++++++++++++ You can use the -`dropSearchIndex() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#dropSearchIndex(java.lang.String)>`__ +`dropSearchIndex() <{+driver-api+}/MongoCollection.html#dropSearchIndex(java.lang.String)>`__ method to remove an Atlas Search index. The following code shows how to delete a search index from a collection: @@ -608,6 +608,6 @@ For prior versions of MongoDB, pass "*" as a parameter to your call to For more information about the methods in this section, see the following API Documentation: -- `dropIndex() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#dropIndex(java.lang.String)>`__ +- `dropIndex() <{+driver-api+}/MongoCollection.html#dropIndex(java.lang.String)>`__ - `dropIndexes() - <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#dropIndexes()>`__ + <{+driver-api+}/MongoCollection.html#dropIndexes()>`__ diff --git a/source/integrations.txt b/source/integrations.txt index fa329cc8a..af3ad44f1 100644 --- a/source/integrations.txt +++ b/source/integrations.txt @@ -10,6 +10,7 @@ Third-Party Integrations .. meta:: :keywords: java sync, third party, tools, frameworks + :description: Explore how to integrate the Java driver with frameworks like Spring Data, Quarkus, and Micronaut for developing applications. .. contents:: On this page :local: diff --git a/source/issues-and-help.txt b/source/issues-and-help.txt index e2a8e327b..0ab030cd7 100644 --- a/source/issues-and-help.txt +++ b/source/issues-and-help.txt @@ -10,6 +10,7 @@ Issues & Help .. meta:: :keywords: java sync, troubleshooting, feedback + :description: Find support for the Java Sync driver through community forums, report bugs or feature requests via Jira, and learn how to contribute to the driver. .. contents:: On this page :local: diff --git a/source/logging-monitoring/change-streams.txt b/source/logging-monitoring/change-streams.txt index d84b41f49..53fb86ed6 100644 --- a/source/logging-monitoring/change-streams.txt +++ b/source/logging-monitoring/change-streams.txt @@ -246,9 +246,9 @@ The preceding applications will generate the following output: To learn more about the ``watch()`` method, see the following API documentation: -- `MongoCollection.watch() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#watch()>`__ -- `MongoDatabase.watch() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#watch()>`__ -- `MongoClient.watch() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html#watch()>`__ +- `MongoCollection.watch() <{+driver-api+}/MongoCollection.html#watch()>`__ +- `MongoDatabase.watch() <{+driver-api+}/MongoDatabase.html#watch()>`__ +- `MongoClient.watch() <{+driver-api+}/MongoClient.html#watch()>`__ .. _java-change-stream-aggregation: @@ -447,7 +447,7 @@ Suppose you update the value of the ``amount`` field in a document from ... } -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. .. _java-post-image-example: @@ -489,7 +489,7 @@ output: ... } -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. Additional Information @@ -500,11 +500,11 @@ API Documentation For more information about the methods and classes used to manage change streams, see the following API documentation: -- `MongoCollection.watch() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#watch()>`__ -- `MongoDatabase.watch() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html#watch()>`__ -- `MongoClient.watch() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html#watch()>`__ -- `ChangeStreamIterable <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/ChangeStreamIterable.html>`__ -- `MongoCursor <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCursor.html>`__ +- `MongoCollection.watch() <{+driver-api+}/MongoCollection.html#watch()>`__ +- `MongoDatabase.watch() <{+driver-api+}/MongoDatabase.html#watch()>`__ +- `MongoClient.watch() <{+driver-api+}/MongoClient.html#watch()>`__ +- `ChangeStreamIterable <{+driver-api+}/ChangeStreamIterable.html>`__ +- `MongoCursor <{+driver-api+}/MongoCursor.html>`__ Server Manual Entries ~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/logging-monitoring/logging.txt b/source/logging-monitoring/logging.txt index ed82a95b8..3bc5560f8 100644 --- a/source/logging-monitoring/logging.txt +++ b/source/logging-monitoring/logging.txt @@ -467,8 +467,8 @@ project. Connection Settings ------------------- -You can apply logging settings to your ``MongoClient`` instance using the `applyToLoggerSettings() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applyToLoggerSettings(com.mongodb.Block)>`__ -and `applicationName() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#applicationName(java.lang.String)>`__ methods. +You can apply logging settings to your ``MongoClient`` instance using the `applyToLoggerSettings() <{+core-api+}/MongoClientSettings.Builder.html#applyToLoggerSettings(com.mongodb.Block)>`__ +and `applicationName() <{+core-api+}/MongoClientSettings.Builder.html#applicationName(java.lang.String)>`__ methods. The following table describes the methods you can chain to your logger settings to modify the logging behavior: @@ -515,5 +515,5 @@ You should see output that resembles the following: ... For more information, see the `MongoClientSettings.Builder -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html>`__ +<{+core-api+}/MongoClientSettings.Builder.html>`__ API documentation. \ No newline at end of file diff --git a/source/logging-monitoring/monitoring.txt b/source/logging-monitoring/monitoring.txt index be1d6116a..c14462660 100644 --- a/source/logging-monitoring/monitoring.txt +++ b/source/logging-monitoring/monitoring.txt @@ -61,7 +61,7 @@ The MongoDB Java driver organizes the events it defines into three categories: The following sections show how to monitor each event category. To learn more about the events you can monitor, see the API documentation for `event classes -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/package-summary.html>`__. +<{+core-api+}/event/package-summary.html>`__. .. _command-events-java: @@ -142,12 +142,12 @@ The preceding code snippet produces output that resembles the following: To learn more about 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-sync/com/mongodb/client/MongoClient.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+}/MongoClient.html>`__ +- `CommandStartedEvent <{+core-api+}/event/CommandStartedEvent.html>`__ +- `CommandSucceededEvent <{+core-api+}/event/CommandSucceededEvent.html>`__ +- `CommandFailedEvent <{+core-api+}/event/CommandFailedEvent.html>`__ Server Discovery and Monitoring Events ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -216,12 +216,12 @@ following: For more information about 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-sync/com/mongodb/client/MongoClient.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+}/MongoClient.html>`__ +- `ClusterDescriptionChangedEvent <{+core-api+}/event/ClusterDescriptionChangedEvent.html>`__ Connection Pool Events ~~~~~~~~~~~~~~~~~~~~~~ @@ -271,11 +271,11 @@ The preceding code snippet produces output that resembles the following: For more information about 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-sync/com/mongodb/client/MongoClient.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+}/MongoClient.html>`__ +- `ConnectionCheckedOutEvent <{+core-api+}/event/ConnectionCheckedOutEvent.html>`__ +- `ConnectionCheckOutFailedEvent <{+core-api+}/event/ConnectionCheckOutFailedEvent.html>`__ .. _monitoring-jmx: @@ -404,7 +404,7 @@ Oracle: To learn more about 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/reference.txt b/source/reference.txt index 03b761d03..5eb0901a9 100644 --- a/source/reference.txt +++ b/source/reference.txt @@ -3,13 +3,18 @@ Reference ========= .. meta:: - :description: Find references material for the {+driver-long+}. + :description: Find reference material related to the {+driver-long+}. .. toctree:: :titlesonly: :maxdepth: 1 - Release Notes - Compatibility - Upgrade - Migrate from the Legacy API + Release Notes + Compatibility + Upgrade + Migrate from the Legacy API + +- :ref:`Release Notes ` +- :ref:`Compatibility ` +- :ref:`Upgrade ` +- :ref:`Migrate from the Legacy API ` diff --git a/source/references/compatibility.txt b/source/reference/compatibility.txt similarity index 92% rename from source/references/compatibility.txt rename to source/reference/compatibility.txt index 7295fb21e..5007723ea 100644 --- a/source/references/compatibility.txt +++ b/source/reference/compatibility.txt @@ -42,7 +42,7 @@ The first column lists the driver version. .. sharedinclude:: dbx/compatibility-table-legend.rst -.. include:: /includes/mongodb-compatibility-table-java.rst +.. sharedinclude:: dbx/mongodb-compatibility-table-java.rst Language Compatibility ---------------------- @@ -54,7 +54,7 @@ Java versions. The first column lists the driver version. -.. include:: /includes/language-compatibility-table-java.rst +.. sharedinclude:: dbx/language-compatibility-table-java.rst For more information about how to read the compatibility tables, see our guide on :ref:`MongoDB Compatibility Tables. ` diff --git a/source/references/legacy.txt b/source/reference/legacy.txt similarity index 52% rename from source/references/legacy.txt rename to source/reference/legacy.txt index fadb747cd..b67eebbad 100644 --- a/source/references/legacy.txt +++ b/source/reference/legacy.txt @@ -58,7 +58,7 @@ API include: - **Native POJO support**, which provides automatic or custom mapping between MongoDB documents and Java objects -To learn about more features of the current API, see :ref:`java-whats-new`. +To learn about more features of the current API, see :ref:`java-release-notes`. API Changes @@ -75,66 +75,66 @@ names between the legacy and current API. * - Legacy - Current - * - `MongoClientOptions <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/MongoClientOptions.html>`__ - - `MongoClientSettings <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html>`__ + * - `MongoClientOptions <{+api-root+}/mongodb-driver-legacy/com/mongodb/MongoClientOptions.html>`__ + - `MongoClientSettings <{+core-api+}/MongoClientSettings.html>`__ - * - `new MongoClient() <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/MongoClient.html>`__ - - `MongoClients.create() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClients.html#create()>`__ + * - `new MongoClient() <{+api-root+}/mongodb-driver-legacy/com/mongodb/MongoClient.html>`__ + - `MongoClients.create() <{+driver-api+}/MongoClients.html#create()>`__ - * - `MongoClient.getDB() <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/MongoClient.html#getDB(java.lang.String)>`__ - - `MongoClient.getDatabase() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html#getDatabase(java.lang.String)>`__ + * - `MongoClient.getDB() <{+api-root+}/mongodb-driver-legacy/com/mongodb/MongoClient.html#getDB(java.lang.String)>`__ + - `MongoClient.getDatabase() <{+driver-api+}/MongoClient.html#getDatabase(java.lang.String)>`__ - * - `DB <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DB.html>`__ - - `MongoDatabase <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoDatabase.html>`__ + * - `DB <{+api-root+}/mongodb-driver-legacy/com/mongodb/DB.html>`__ + - `MongoDatabase <{+driver-api+}/MongoDatabase.html>`__ - * - `DBCollection <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DBCollection.html>`__ - - `MongoCollection<> <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html>`__ + * - `DBCollection <{+api-root+}/mongodb-driver-legacy/com/mongodb/DBCollection.html>`__ + - `MongoCollection<> <{+driver-api+}/MongoCollection.html>`__ - * - `DBCursor <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DBCursor.html>`__ - - `MongoCursor <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCursor.html>`__ + * - `DBCursor <{+api-root+}/mongodb-driver-legacy/com/mongodb/DBCursor.html>`__ + - `MongoCursor <{+driver-api+}/MongoCursor.html>`__ - * - `DBCollection.findOne() <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DBCollection.html#findOne()>`__ + * - `DBCollection.findOne() <{+api-root+}/mongodb-driver-legacy/com/mongodb/DBCollection.html#findOne()>`__ - | ``MongoCollection.find().first()`` | | See the following API documentation pages for these methods: - - `find() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#find()>`__ - - `first() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoIterable.html#first()>`__ + - `find() <{+driver-api+}/MongoCollection.html#find()>`__ + - `first() <{+driver-api+}/MongoIterable.html#first()>`__ - * - `DBCollection.insert() <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DBCollection.html#insert(com.mongodb.DBObject...)>`__ + * - `DBCollection.insert() <{+api-root+}/mongodb-driver-legacy/com/mongodb/DBCollection.html#insert(com.mongodb.DBObject...)>`__ - Use one of the following methods: - - `MongoCollection.insertOne() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#insertOne(TDocument)>`__ - - `MongoCollection.insertMany() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#insertMany(java.util.List)>`__ + - `MongoCollection.insertOne() <{+driver-api+}/MongoCollection.html#insertOne(TDocument)>`__ + - `MongoCollection.insertMany() <{+driver-api+}/MongoCollection.html#insertMany(java.util.List)>`__ - * - `DBCollection.update() <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DBCollection.html#update(com.mongodb.DBObject,com.mongodb.DBObject)>`__ + * - `DBCollection.update() <{+api-root+}/mongodb-driver-legacy/com/mongodb/DBCollection.html#update(com.mongodb.DBObject,com.mongodb.DBObject)>`__ - Use one of the following methods: - - `MongoCollection.updateOne() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#updateOne(org.bson.conversions.Bson,java.util.List)>`__ - - `MongoCollection.updateMany() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#updateMany(org.bson.conversions.Bson,java.util.List)>`__ - - `MongoCollection.replaceOne() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#replaceOne(org.bson.conversions.Bson,TDocument)>`__ + - `MongoCollection.updateOne() <{+driver-api+}/MongoCollection.html#updateOne(org.bson.conversions.Bson,java.util.List)>`__ + - `MongoCollection.updateMany() <{+driver-api+}/MongoCollection.html#updateMany(org.bson.conversions.Bson,java.util.List)>`__ + - `MongoCollection.replaceOne() <{+driver-api+}/MongoCollection.html#replaceOne(org.bson.conversions.Bson,TDocument)>`__ - * - `DBCollection.remove() <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DBCollection.html#remove(com.mongodb.DBObject)>`__ + * - `DBCollection.remove() <{+api-root+}/mongodb-driver-legacy/com/mongodb/DBCollection.html#remove(com.mongodb.DBObject)>`__ - Use one of the following methods: - - `MongoCollection.deleteOne() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#deleteOne(org.bson.conversions.Bson)>`__ - - `MongoCollection.deleteMany() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#deleteMany(org.bson.conversions.Bson)>`__ + - `MongoCollection.deleteOne() <{+driver-api+}/MongoCollection.html#deleteOne(org.bson.conversions.Bson)>`__ + - `MongoCollection.deleteMany() <{+driver-api+}/MongoCollection.html#deleteMany(org.bson.conversions.Bson)>`__ - * - `DBCollection.count() <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DBCollection.html#count()>`__ + * - `DBCollection.count() <{+api-root+}/mongodb-driver-legacy/com/mongodb/DBCollection.html#count()>`__ - Use one of the following methods: - - `MongoCollection.countDocuments() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#countDocuments()>`__ - - `MongoCollection.estimatedDocumentCount() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#estimatedDocumentCount()>`__ + - `MongoCollection.countDocuments() <{+driver-api+}/MongoCollection.html#countDocuments()>`__ + - `MongoCollection.estimatedDocumentCount() <{+driver-api+}/MongoCollection.html#estimatedDocumentCount()>`__ - * - `DBCollection.findAndModify() <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DBCollection.html#findAndModify(com.mongodb.DBObject,com.mongodb.client.model.DBCollectionFindAndModifyOptions)>`__ + * - `DBCollection.findAndModify() <{+api-root+}/mongodb-driver-legacy/com/mongodb/DBCollection.html#findAndModify(com.mongodb.DBObject,com.mongodb.client.model.DBCollectionFindAndModifyOptions)>`__ - Use one of the following methods: - - `MongoCollection.findOneAndUpdate() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#findOneAndUpdate(org.bson.conversions.Bson,org.bson.conversions.Bson)>`__ - - `MongoCollection.findOneAndReplace() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#findOneAndReplace(org.bson.conversions.Bson,TDocument)>`__ - - `MongoCollection.findOneAndDelete() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#findOneAndDelete(org.bson.conversions.Bson)>`__ + - `MongoCollection.findOneAndUpdate() <{+driver-api+}/MongoCollection.html#findOneAndUpdate(org.bson.conversions.Bson,org.bson.conversions.Bson)>`__ + - `MongoCollection.findOneAndReplace() <{+driver-api+}/MongoCollection.html#findOneAndReplace(org.bson.conversions.Bson,TDocument)>`__ + - `MongoCollection.findOneAndDelete() <{+driver-api+}/MongoCollection.html#findOneAndDelete(org.bson.conversions.Bson)>`__ - * - `QueryBuilder <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/QueryBuilder.html>`__ - - `Filters <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Filters.html>`__ + * - `QueryBuilder <{+api-root+}/mongodb-driver-legacy/com/mongodb/QueryBuilder.html>`__ + - `Filters <{+core-api+}/client/model/Filters.html>`__ In addition to the preceding items, consider the following changes: @@ -148,8 +148,8 @@ In addition to the preceding items, consider the following changes: guide. - The default generic type for ``MongoCollection`` in the current API is - `org.bson.Document <{+api+}/apidocs/bson/org/bson/Document.html>`__. - You can specify `BasicDBObject <{+api+}/apidocs/mongodb-driver-core/com/mongodb/BasicDBObject.html>`__ + `org.bson.Document <{+api-root+}/bson/org/bson/Document.html>`__. + You can specify `BasicDBObject <{+core-api+}/BasicDBObject.html>`__ as a type parameter if it eases your migration. - In the current API, the aggregation pipeline you pass to the ``aggregate()`` @@ -160,10 +160,10 @@ In addition to the preceding items, consider the following changes: The method signatures also differ between the APIs. See the following API documentation for more information: - - `aggregate() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#aggregate(java.util.List)>`__ method in the current API - - `aggregate() <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DBCollection.html#aggregate(java.util.List,com.mongodb.AggregationOptions)>`__ method in the legacy API - - `Bson <{+api+}/apidocs/bson/org/bson/conversions/Bson.html>`__ interface - - `DBObject <{+api+}/apidocs/mongodb-driver-core/com/mongodb/DBObject.html>`__ interface + - `aggregate() <{+driver-api+}/MongoCollection.html#aggregate(java.util.List)>`__ method in the current API + - `aggregate() <{+api-root+}/mongodb-driver-legacy/com/mongodb/DBCollection.html#aggregate(java.util.List,com.mongodb.AggregationOptions)>`__ method in the legacy API + - `Bson <{+api-root+}/bson/org/bson/conversions/Bson.html>`__ interface + - `DBObject <{+core-api+}/DBObject.html>`__ interface .. _java-legacy-api-faq: @@ -215,14 +215,14 @@ The output of the preceding code snippet resembles the following: For more information about the legacy classes and methods used in the preceding example, see the following API documentation pages: -- `MongoClient <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/MongoClient.html>`__ -- `DB <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DB.html>`__ -- `DBCollection <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DBCollection.html>`__ -- `DBObject <{+api+}/apidocs/mongodb-driver-core/com/mongodb/DBObject.html>`__ -- `getDB() <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/MongoClient.html#getDB(java.lang.String)>`__ -- `getCollection() <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DB.html#getCollection(java.lang.String)>`__ -- `find() <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DBCollection.html#find()>`__ -- `one() <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/DBCursor.html#one()>`__ +- `MongoClient <{+api-root+}/mongodb-driver-legacy/com/mongodb/MongoClient.html>`__ +- `DB <{+api-root+}/mongodb-driver-legacy/com/mongodb/DB.html>`__ +- `DBCollection <{+api-root+}/mongodb-driver-legacy/com/mongodb/DBCollection.html>`__ +- `DBObject <{+core-api+}/DBObject.html>`__ +- `getDB() <{+api-root+}/mongodb-driver-legacy/com/mongodb/MongoClient.html#getDB(java.lang.String)>`__ +- `getCollection() <{+api-root+}/mongodb-driver-legacy/com/mongodb/DB.html#getCollection(java.lang.String)>`__ +- `find() <{+api-root+}/mongodb-driver-legacy/com/mongodb/DBCollection.html#find()>`__ +- `one() <{+api-root+}/mongodb-driver-legacy/com/mongodb/DBCursor.html#one()>`__ See the :ref:`Migrate from the Legacy API ` page for a list of differences between the legacy and current API. @@ -256,10 +256,10 @@ The following example shows how to use the legacy ``MongoClientOptions`` and For more information about the legacy classes and methods used in the preceding example, see the following API documentation: -- `Legacy API documentation <{+api+}/apidocs/mongodb-driver-legacy/index.html>`__ -- `MongoClient <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/MongoClient.html>`__ -- `MongoClientOptions <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/MongoClientOptions.html>`__ -- `MongoClientURI <{+api+}/apidocs/mongodb-driver-legacy/com/mongodb/MongoClientURI.html>`__ +- `Legacy API documentation <{+api-root+}/mongodb-driver-legacy/index.html>`__ +- `MongoClient <{+api-root+}/mongodb-driver-legacy/com/mongodb/MongoClient.html>`__ +- `MongoClientOptions <{+api-root+}/mongodb-driver-legacy/com/mongodb/MongoClientOptions.html>`__ +- `MongoClientURI <{+api-root+}/mongodb-driver-legacy/com/mongodb/MongoClientURI.html>`__ See the :ref:`Migrate from the Legacy API ` page for a list of differences between the legacy and current API. \ No newline at end of file diff --git a/source/references/whats-new.txt b/source/reference/release-notes.txt similarity index 93% rename from source/references/whats-new.txt rename to source/reference/release-notes.txt index b65f7f8b9..7ceca65e7 100644 --- a/source/references/whats-new.txt +++ b/source/reference/release-notes.txt @@ -1,8 +1,9 @@ .. _java-whats-new: +.. _java-release-notes: -========== -What's New -========== +============= +Release Notes +============= .. facet:: :name: genre @@ -41,6 +42,10 @@ and features: .. sharedinclude:: dbx/jvm/v5.4-wn-items.rst + .. replacement:: install-bom-link + + the :ref:`Add the {+driver-short+} Bill of Materials ` step of the Get Started tutorial + .. replacement:: sort-option-link the :ref:`java-sync-client-bulk-write-update` and @@ -54,7 +59,7 @@ and features: .. replacement:: atlas-query-operators - the :ref:`java-atlas-search` guide + the :ref:`java-atlas-search-helpers` section of the Atlas Search guide .. _java-version-5.3: @@ -124,6 +129,10 @@ and features: .. sharedinclude:: dbx/jvm/v5.2-wn-items.rst + .. replacement:: csot-link + + the :ref:`java-csot` guide + .. replacement:: avs-index-link :ref:`java-search-indexes` in the Indexes guide @@ -136,12 +145,6 @@ and features: :ref:`java-atlas-vector-search` in the Aggregates Builders guide - .. replacement:: csot-link - - the `MongoClientSettings.Builder.timeout() - <{+core-api+}/com/mongodb/MongoClientSettings.Builder.html#timeout(long,java.util.concurrent.TimeUnit)>`__ - API documentation - .. _java-version-5.1.3: What's New in 5.1.3 @@ -360,7 +363,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 @@ -369,7 +372,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 @@ -411,7 +414,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 @@ -455,9 +458,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 @@ -471,9 +474,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: diff --git a/source/references/upgrade.txt b/source/reference/upgrade.txt similarity index 98% rename from source/references/upgrade.txt rename to source/reference/upgrade.txt index 9b76364f8..207306fc7 100644 --- a/source/references/upgrade.txt +++ b/source/reference/upgrade.txt @@ -161,7 +161,7 @@ This driver version introduces the following breaking changes: ``BsonDecimal128.isNumber()`` now returns ``true``, and ``BsonDecimal128.asNumber()`` returns the equivalent ``BsonNumber``. -- Removes the `ServerAddress <{+api+}/apidocs/mongodb-driver-core/com/mongodb/ServerAddress.html>`__ +- Removes the `ServerAddress <{+core-api+}/ServerAddress.html>`__ methods ``getSocketAddress()`` and ``getSocketAddresses()``. Instead of ``getSocketAddress()``, use the ``getByName()`` instance @@ -170,7 +170,7 @@ This driver version introduces the following breaking changes: Instead of ``getSocketAddresses()``, use the ``getAllByName()`` instance method of ``java.net.InetAddress``. -- Removes the `UnixServerAddress <{+api+}/apidocs/mongodb-driver-core/com/mongodb/UnixServerAddress.html>`__ +- Removes the `UnixServerAddress <{+core-api+}/UnixServerAddress.html>`__ methods ``getSocketAddress()`` and ``getUnixSocketAddress()``. Instead of ``getUnixSocketAddress()``, construct an instance of @@ -288,7 +288,7 @@ This driver version introduces the following breaking changes: - ``connectionRemoved`` For more information about the events package, see the `com.mongodb.event - package documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/event/package-summary.html>`__ + package documentation <{+core-api+}/event/package-summary.html>`__ .. _java-breaking-changes-v5.0-list-collections: diff --git a/source/security/auth/aws-iam.txt b/source/security/auth/aws-iam.txt index f8c8870ae..647111fcd 100644 --- a/source/security/auth/aws-iam.txt +++ b/source/security/auth/aws-iam.txt @@ -263,7 +263,7 @@ in the following example: :emphasize-lines: 1,8 If you must 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:: /includes/fundamentals/code-snippets/MongoDbAwsAuth.java @@ -294,6 +294,6 @@ API Documentation To learn more about any of the methods or types discussed on this page, see the following API documentation: -- `MongoClient <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html>`__ -- `MongoCredential <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html>`__ -- `MongoCredential.createAwsCredential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createAwsCredential(java.lang.String,char%5B%5D)>`__ +- `MongoClient <{+driver-api+}/MongoClient.html>`__ +- `MongoCredential <{+core-api+}/MongoCredential.html>`__ +- `MongoCredential.createAwsCredential() <{+core-api+}/MongoCredential.html#createAwsCredential(java.lang.String,char%5B%5D)>`__ diff --git a/source/security/auth/kerberos.txt b/source/security/auth/kerberos.txt index 159d75ae0..a4960e7c3 100644 --- a/source/security/auth/kerberos.txt +++ b/source/security/auth/kerberos.txt @@ -29,7 +29,7 @@ Code Placeholders The code examples on this page use the following placeholders: -- ````: Your :wikipedia:`URL-encoded ` principal name. For +- ````: Your :wikipedia:`URL-encoded ` principal name. For example: ``"username%40REALM.ME"`` - ````: The network address of your MongoDB deployment. - ````: The port number of your MongoDB deployment. If you omit this parameter, @@ -64,7 +64,7 @@ mechanism: .. code-block:: java - MongoClient mongoClient = MongoClients.create("@:/?authSource=$external&authMechanism=GSSAPI"); + MongoClient mongoClient = MongoClients.create("@:/?authSource=$external&authMechanism=GSSAPI"); .. tab:: :tabid: MongoCredential @@ -125,7 +125,7 @@ You might need to specify one or more of the following .. code-block:: java - MongoClient mongoClient = MongoClients.create("@:/?authSource=$external&authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:myService"); + MongoClient mongoClient = MongoClients.create("@:/?authSource=$external&authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:myService"); .. tab:: :tabid: MongoCredential @@ -135,11 +135,11 @@ You might need to specify one or more of the following 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 @@ -206,7 +206,7 @@ API Documentation To learn more about any of the methods or types discussed on this page, see the following API documentation: -- `MongoClient <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html>`__ -- `MongoCredential <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html>`__ -- `MongoCredential.createGSSAPICredential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createGSSAPICredential(java.lang.String)>`__ -- `MongoCredential.withMechanismProperty() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#withMechanismProperty(java.lang.String,T)>`__ \ No newline at end of file +- `MongoClient <{+driver-api+}/MongoClient.html>`__ +- `MongoCredential <{+core-api+}/MongoCredential.html>`__ +- `MongoCredential.createGSSAPICredential() <{+core-api+}/MongoCredential.html#createGSSAPICredential(java.lang.String)>`__ +- `MongoCredential.withMechanismProperty() <{+core-api+}/MongoCredential.html#withMechanismProperty(java.lang.String,T)>`__ \ No newline at end of file diff --git a/source/security/auth/ldap.txt b/source/security/auth/ldap.txt index 0231513a3..2fce4850e 100644 --- a/source/security/auth/ldap.txt +++ b/source/security/auth/ldap.txt @@ -34,8 +34,8 @@ Code Placeholders The code examples on this page use the following placeholders: -- ````: Your LDAP username. -- ````: Your LDAP password. +- ````: Your LDAP username. +- ````: Your LDAP password. - ````: The network address of your MongoDB deployment. - ````: The port number of your MongoDB deployment. If you omit this parameter, the driver uses the default port number (``27017``). You don't need to specify a port @@ -70,7 +70,7 @@ mechanism: .. code-block:: java - MongoClient mongoClient = MongoClients.create(":@:/?authSource=$external&authMechanism=PLAIN"); + MongoClient mongoClient = MongoClients.create(":@:/?authSource=$external&authMechanism=PLAIN"); .. tab:: :tabid: MongoCredential @@ -87,6 +87,6 @@ API Documentation To learn more about any of the methods or types discussed on this page, see the following API documentation: -- `MongoClient <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html>`__ -- `MongoCredential <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html>`__ -- `MongoCredential.createPlainCredential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createPlainCredential(java.lang.String,java.lang.String,char%5B%5D)>`__ +- `MongoClient <{+driver-api+}/MongoClient.html>`__ +- `MongoCredential <{+core-api+}/MongoCredential.html>`__ +- `MongoCredential.createPlainCredential() <{+core-api+}/MongoCredential.html#createPlainCredential(java.lang.String,java.lang.String,char%5B%5D)>`__ diff --git a/source/security/auth/oidc.txt b/source/security/auth/oidc.txt index 92fd6cc19..6cd4f327a 100644 --- a/source/security/auth/oidc.txt +++ b/source/security/auth/oidc.txt @@ -275,7 +275,7 @@ API Documentation To learn more about any of the methods or types discussed on this page, see the following API documentation: -- `MongoClient <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html>`__ -- `MongoCredential <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html>`__ -- `MongoCredential.createOidcCredential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createOidcCredential(java.lang.String)>`__ -- `MongoCredential.withMechanismProperty() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#withMechanismProperty(java.lang.String,T)>`__ +- `MongoClient <{+driver-api+}/MongoClient.html>`__ +- `MongoCredential <{+core-api+}/MongoCredential.html>`__ +- `MongoCredential.createOidcCredential() <{+core-api+}/MongoCredential.html#createOidcCredential(java.lang.String)>`__ +- `MongoCredential.withMechanismProperty() <{+core-api+}/MongoCredential.html#withMechanismProperty(java.lang.String,T)>`__ diff --git a/source/security/auth/scram.txt b/source/security/auth/scram.txt index c36777695..87b7467ea 100644 --- a/source/security/auth/scram.txt +++ b/source/security/auth/scram.txt @@ -162,8 +162,8 @@ API Documentation To learn more about any of the methods or types discussed on this page, see the following API documentation: -- `MongoClient <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html>`__ -- `MongoCredential <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html>`__ -- `MongoCredential.createCredential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createCredential(java.lang.String,java.lang.String,char%5B%5D)>`__ -- `MongoCredential.createScramSha256Credential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createScramSha256Credential(java.lang.String,java.lang.String,char[])>`__ -- `MongoCredential.createScramSha1Credential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createScramSha1Credential(java.lang.String,java.lang.String,char[])>`__ \ No newline at end of file +- `MongoClient <{+driver-api+}/MongoClient.html>`__ +- `MongoCredential <{+core-api+}/MongoCredential.html>`__ +- `MongoCredential.createCredential() <{+core-api+}/MongoCredential.html#createCredential(java.lang.String,java.lang.String,char%5B%5D)>`__ +- `MongoCredential.createScramSha256Credential() <{+core-api+}/MongoCredential.html#createScramSha256Credential(java.lang.String,java.lang.String,char[])>`__ +- `MongoCredential.createScramSha1Credential() <{+core-api+}/MongoCredential.html#createScramSha1Credential(java.lang.String,java.lang.String,char[])>`__ \ No newline at end of file diff --git a/source/security/auth/x509.txt b/source/security/auth/x509.txt index d82146730..d54bdf69d 100644 --- a/source/security/auth/x509.txt +++ b/source/security/auth/x509.txt @@ -76,9 +76,9 @@ mechanism: To specify the ``X.509`` authentication mechanism by using the ``MongoCredential`` class, use the ``createMongoX509Credential()`` 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. The code to instantiate a ``MongoClient`` resembles the following: @@ -90,7 +90,7 @@ API Documentation To learn more about any of the MongoDB methods and types used on this page, see the following API documentation: -- `MongoClient <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html>`__ -- `MongoCredential <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html>`__ -- `MongoCredential.createMongoX509Credential() <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoCredential.html#createMongoX509Credential(java.lang.String)>`__ +- `MongoClient <{+driver-api+}/MongoClient.html>`__ +- `MongoCredential <{+core-api+}/MongoCredential.html>`__ +- `MongoCredential.createMongoX509Credential() <{+core-api+}/MongoCredential.html#createMongoX509Credential(java.lang.String)>`__ diff --git a/source/security/encrypt-fields.txt b/source/security/encrypt-fields.txt index 8cd36addc..f26de05cf 100644 --- a/source/security/encrypt-fields.txt +++ b/source/security/encrypt-fields.txt @@ -25,23 +25,4 @@ .. tab:: Gradle :tabid: gradle-dependency - .. include:: /includes/fundamentals/code-snippets/crypt-gradle-versioned.rst - -Connection Settings -------------------- - -You can apply encryption settings when creating a ``MongoClient`` instance by -passing an `AutoEncryptionSettings -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/AutoEncryptionSettings.html>`__ -object to the `autoEncryptionSettings() -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#autoEncryptionSettings(com.mongodb.AutoEncryptionSettings)>`__ -method. - -.. TODO: Add example - -.. note:: - - If you omit ``keyVaultClient`` or set ``bypassAutomaticEncryption`` to false - in your ``AutoEncryptionSettings``, the driver creates a separate, internal - ``MongoClient``. The internal ``MongoClient`` configuration differs from the - parent ``MongoClient`` by setting the ``minPoolSize`` to 0 and omitting the ``AutoEncryptionSettings``. \ No newline at end of file + .. include:: /includes/fundamentals/code-snippets/crypt-gradle-versioned.rst \ No newline at end of file diff --git a/source/security/socks.txt b/source/security/socks.txt index 134949341..4e1b549c2 100644 --- a/source/security/socks.txt +++ b/source/security/socks.txt @@ -29,7 +29,7 @@ SOCKS5 Proxy Settings The proxy settings specify the SOCKS5 proxy server address and your authentication credentials. You can specify your settings in an instance of -`MongoClientSettings <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html>`__ +`MongoClientSettings <{+core-api+}/MongoClientSettings.html>`__ or in your :ref:`connection string `. .. important:: @@ -37,9 +37,9 @@ or in your :ref:`connection string `. The driver ignores the proxy settings if either of the following are true: - A Unix domain socket handles the communication. - For more information, see the `UnixServerAddress documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/UnixServerAddress.html>`__. + For more information, see the `UnixServerAddress documentation <{+core-api+}/UnixServerAddress.html>`__. - ``TransportSettings`` are configured. - For more information, see the `TransportSettings documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/connection/TransportSettings.html>`__. + For more information, see the `TransportSettings documentation <{+core-api+}/connection/TransportSettings.html>`__. The following table describes the SOCKS5 client options: @@ -138,7 +138,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>`__ -- `MongoClients.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>`__ +- `MongoClientSettings.Builder <{+core-api+}/MongoClientSettings.Builder.html>`__ +- `SocketSettings.Builder <{+core-api+}/connection/SocketSettings.Builder.html>`__ +- `MongoClients.create() <{+driver-api+}/MongoClients.html#create(com.mongodb.MongoClientSettings)>`__ +- `ProxySettings.Builder <{+core-api+}/connection/ProxySettings.Builder.html>`__ diff --git a/source/security/tls.txt b/source/security/tls.txt index 27cb2d988..d38ed1440 100644 --- a/source/security/tls.txt +++ b/source/security/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 @@ -62,7 +62,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 ``MongoClients.create()``: @@ -118,7 +118,7 @@ using a method in the ``MongoClientSettings.Builder`` class. To configure your ``MongoClient``'s TLS/SSL connection options using the ``MongoClientSettings.Builder`` class, chain 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: @@ -349,12 +349,12 @@ provided by Netty. To instruct the driver to use `io.netty.handler.ssl.SslContext `__, configure -`NettyTransportSettings <{+api+}/apidocs/mongodb-driver-core/com/mongodb/connection/NettyTransportSettings.html>`__ -when you define your `MongoClientSettings <{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.html>`__. +`NettyTransportSettings <{+core-api+}/connection/NettyTransportSettings.html>`__ +when you define your `MongoClientSettings <{+core-api+}/MongoClientSettings.html>`__. Use `MongoClientSettings.Builder.transportSettings -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/MongoClientSettings.Builder.html#transportSettings(com.mongodb.connection.TransportSettings)>`__ +<{+core-api+}/MongoClientSettings.Builder.html#transportSettings(com.mongodb.connection.TransportSettings)>`__ and `NettyTransportSettings.Builder.sslContext -<{+api+}/apidocs/mongodb-driver-core/com/mongodb/connection/NettyTransportSettings.Builder.html#sslContext(io.netty.handler.ssl.SslContext)>`__ +<{+core-api+}/connection/NettyTransportSettings.Builder.html#sslContext(io.netty.handler.ssl.SslContext)>`__ to build your settings: .. code-block:: java