diff --git a/config/redirects b/config/redirects index 516938d..72fd736 100644 --- a/config/redirects +++ b/config/redirects @@ -1,6 +1,6 @@ define: prefix docs/languages/kotlin/kotlin-sync-driver define: base https://www.mongodb.com/docs/ -define: versions v5.1 v5.2 master +define: versions v5.1 v5.2 v5.3 master symlink: current -> master diff --git a/snooty.toml b/snooty.toml index 61a5bc7..6a54952 100644 --- a/snooty.toml +++ b/snooty.toml @@ -24,7 +24,7 @@ sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/" driver-long = "MongoDB Kotlin Sync Driver" driver-short = "Kotlin Sync driver" language = "Kotlin" -version-number = "5.2" +version-number = "5.3" full-version = "{+version-number+}.0" version = "v{+version-number+}" mdb-server = "MongoDB Server" @@ -33,6 +33,6 @@ api = "https://mongodb.github.io/mongo-java-driver/{+version-number+}/apidocs/mo java-api = "https://mongodb.github.io/mongo-java-driver/{+version-number+}" core-api = "{+java-api+}/apidocs/mongodb-driver-core" kotlin-docs = "https://kotlinlang.org" -serialization-version = "1.5.1" +serialization-version = "1.6.0" kotlinx-dt-version = "0.6.1" mongocrypt-version = "{+full-version+}" diff --git a/source/whats-new.txt b/source/whats-new.txt index 2453169..bf6cf46 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -12,6 +12,7 @@ What's New Learn what's new in: +* :ref:`Version 5.3 ` * :ref:`Version 5.2 ` * :ref:`Version 5.1.3 ` * :ref:`Version 5.1.2 ` @@ -19,6 +20,28 @@ Learn what's new in: * :ref:`Version 5.1 ` * :ref:`Version 5.0 ` +.. _kotlin-sync-version-5.3: + +What's New in 5.3 +----------------- + +The 5.3 driver release includes the following new features, +improvements, and fixes: + +.. sharedinclude:: dbx/jvm/v5.3-wn-items.rst + + .. replacement:: vector-type-example-link + + To learn about this type, see the + `BinaryVector <{+java-api+}/apidocs/bson/org/bson/BinaryVector.html>`__ + API documentation. + + .. replacement:: update-replace-example-link + + the :ref:`kotlin-sync-write-update`, + :ref:`kotlin-sync-write-replace`, and + :ref:`kotlin-sync-bulk-write` guides + .. _kotlin-sync-version-5.2: What's New in 5.2 diff --git a/source/work-with-indexes.txt b/source/work-with-indexes.txt index 4114602..ee4a286 100644 --- a/source/work-with-indexes.txt +++ b/source/work-with-indexes.txt @@ -21,7 +21,7 @@ Work with Indexes Single Field Compound - Atlas & Vector Search + Atlas Search & Vector Search Overview -------- diff --git a/source/write/bulk-write.txt b/source/write/bulk-write.txt index 220ffed..af4b779 100644 --- a/source/write/bulk-write.txt +++ b/source/write/bulk-write.txt @@ -116,6 +116,16 @@ The following example creates an instance of ``UpdateOneModel``: :copyable: :dedent: +If multiple documents match the query filter specified in +the ``UpdateOneModel`` instance, the operation updates the first +result. You can specify a sort in an ``UpdateOptions`` instance to apply +an order to matched documents before the driver performs the update +operation, as shown in the following code: + +.. code-block:: kotlin + + val opts = UpdateOptions().sort(Sorts.ascending(Restaurant::name.name)) + To update multiple documents, create an instance of ``UpdateManyModel`` and pass the same arguments as for ``UpdateOneModel``. The ``UpdateManyModel`` class specifies updates for *all* documents that match your query @@ -148,8 +158,20 @@ The following example creates an instance of ``ReplaceOneModel``: :copyable: :dedent: -To replace multiple documents, you must create an instance of -``ReplaceOneModel`` for each document. +If multiple documents match the query filter specified in +the ``ReplaceOneModel`` instance, the operation replaces the first +result. You can specify a sort in a ``ReplaceOptions`` instance to apply +an order to matched documents before the driver performs the replace +operation, as shown in the following code: + +.. code-block:: kotlin + + val opts = ReplaceOptions().sort(Sorts.ascending(Restaurant::name.name)) + +.. tip:: Replace Multiple Documents + + To replace multiple documents, create an instance of + ``ReplaceOneModel`` for each document. Delete Operations ~~~~~~~~~~~~~~~~~ diff --git a/source/write/replace.txt b/source/write/replace.txt index c39ff1a..be18964 100644 --- a/source/write/replace.txt +++ b/source/write/replace.txt @@ -113,6 +113,13 @@ configure an ``ReplaceOptions`` instance: in the {+mdb-server+} manual. | Defaults to ``false`` + * - ``sort(Bson sort)`` + - | Sets the sort criteria to apply to the operation. If multiple + documents match the query filter that you pass to the + ``replaceOne()`` method, the operation replaces the first + result. You can set this option to apply an order to matched + documents to have more control over which document is replaced. + * - ``bypassDocumentValidation()`` - | Specifies whether the update operation bypasses document validation. This lets you update documents that don't meet the schema validation requirements, if any diff --git a/source/write/update.txt b/source/write/update.txt index b171bf9..2f7a628 100644 --- a/source/write/update.txt +++ b/source/write/update.txt @@ -113,6 +113,13 @@ configure an ``UpdateOptions`` instance: in the {+mdb-server+} manual. | Defaults to ``false`` + * - ``sort(Bson sort)`` + - | Sets the sort criteria to apply to the operation. If multiple + documents match the query filter that you pass to the + ``updateOne()`` method, the operation updates the first + result. You can set this option to apply an order to matched + documents to have more control over which document is updated. + * - ``bypassDocumentValidation()`` - | Specifies whether the update operation bypasses document validation. This lets you update documents that don't meet the schema validation requirements, if any