Skip to content

Commit

Permalink
DOCSP-43826: v5.2 release (#175)
Browse files Browse the repository at this point in the history
* DOCSP-43826: v5.2 release

* test fixes

* avs updates

* wip

* docs-shared updated

* trim tables - MW

* condense tables
  • Loading branch information
rustagir authored Sep 25, 2024
1 parent f2576a5 commit 2e93b14
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 78 deletions.
2 changes: 1 addition & 1 deletion config/redirects
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
define: prefix docs/drivers/kotlin/coroutine
define: base https://www.mongodb.com/${prefix}
define: versions v4.10 v4.11 v5.0 v5.1 master
define: versions v4.10 v4.11 v5.0 v5.1 v5.2 master

raw: ${prefix}/ -> ${base}/current/

Expand Down
2 changes: 1 addition & 1 deletion examples/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
kotlin.code.style=official
kotlin_mongodb_version=5.1.4
kotlin_mongodb_version=5.2.0
6 changes: 3 additions & 3 deletions examples/src/test/kotlin/AggregatesBuilderTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import com.mongodb.client.model.geojson.Position
import com.mongodb.client.model.search.SearchOperator
import com.mongodb.client.model.search.SearchOptions
import com.mongodb.client.model.search.SearchPath
import com.mongodb.client.model.search.VectorSearchOptions.vectorSearchOptions
import com.mongodb.client.model.search.VectorSearchOptions.exactVectorSearchOptions
import com.mongodb.kotlin.client.coroutine.MongoClient
import config.getConfig
import kotlinx.coroutines.flow.firstOrNull
Expand Down Expand Up @@ -981,13 +981,13 @@ class AggregatesBuilderTest {
SearchPath.fieldPath(MovieAlt::plotEmbedding.name),
listOf(-0.0072121937, -0.030757688, -0.012945653),
"mflix_movies_embedding_index",
2.toLong(),
1.toLong(),
vectorSearchOptions().filter(Filters.gte(MovieAlt::year.name, 2016))
exactVectorSearchOptions().filter(Filters.gte(MovieAlt::year.name, 2016))
)
// :snippet-end:
)
)

val results = resultsFlow.toList()
assertEquals(1, resultsFlow.toList().size)
assertEquals(1, results.first().get("count", Document::class.java).get("lowerBound", java.lang.Long::class.java)?.toInt())
Expand Down
1 change: 1 addition & 0 deletions examples/src/test/kotlin/SearchIndexesTest.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

import com.mongodb.client.model.SearchIndexModel
import com.mongodb.client.model.SearchIndexType
import com.mongodb.kotlin.client.coroutine.MongoClient
import config.getConfig
import kotlinx.coroutines.flow.toList
Expand Down
4 changes: 2 additions & 2 deletions snooty.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/"
driver = "kotlin"
driver-short = "Kotlin driver"
driver-long = "MongoDB Kotlin Driver"
version = "5.1"
full-version = "{+version+}.4"
version = "5.2"
full-version = "{+version+}.0"
language = "Kotlin"
mdb-server = "MongoDB server"
kotlin-docs = "https://kotlinlang.org"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Aggregates.vectorSearch(
SearchPath.fieldPath(MovieAlt::plotEmbedding.name),
listOf(-0.0072121937, -0.030757688, -0.012945653),
"mflix_movies_embedding_index",
2.toLong(),
1.toLong(),
vectorSearchOptions().filter(Filters.gte(MovieAlt::year.name, 2016))
exactVectorSearchOptions().filter(Filters.gte(MovieAlt::year.name, 2016))
)
5 changes: 2 additions & 3 deletions source/fundamentals/builders/aggregates.txt
Original file line number Diff line number Diff line change
Expand Up @@ -932,13 +932,12 @@ The example in this section uses data modeled with the following Kotlin data cla
:language: kotlin

This example shows how to build an aggregation pipeline that uses the
``vectorSearch()`` method to perform a vector search with the following
``vectorSearch()`` method to perform an exact vector search with the following
specifications:

- Searches ``plotEmbedding`` field values by using vector embeddings of a
string value
- Uses the ``mflix_movies_embedding_index`` vector search index
- Considers up to 2 nearest neighbors
- Returns 1 document
- Filters for documents in which the ``year`` value is at least ``2016``

Expand All @@ -947,4 +946,4 @@ specifications:

To learn more about this helper, see the
`vectorSearch() API documentation
<{+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,long)>`__.
<{+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)>`__.
5 changes: 5 additions & 0 deletions source/fundamentals/indexes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ The following code example shows how to create an Atlas Search index:
.. literalinclude:: /examples/generated/SearchIndexesTest.snippet.single-search-index-create.kt
:language: kotlin

To create multiple Search or Vector Search indexes, you must create a
`SearchIndexModel
<{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/SearchIndexModel.html>`__
instance for each index.

The following code example shows how to create Search and
Vector Search indexes in one call:

Expand Down
11 changes: 1 addition & 10 deletions source/includes/language-compatibility-table-kotlin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,5 @@
* - Kotlin Driver Version
- Kotlin 1.8

* - 5.1
- ✓

* - 5.0
- ✓

* - 4.11
- ✓

* - 4.10
* - 4.10 to 5.2
- ✓
57 changes: 1 addition & 56 deletions source/includes/mongodb-compatibility-table-kotlin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@
- MongoDB 4.2
- MongoDB 4.0
- MongoDB 3.6
- MongoDB 3.4
- MongoDB 3.2
- MongoDB 3.0
- MongoDB 2.6

* - 5.2
- ✓
Expand All @@ -26,12 +22,8 @@
- ✓
- ✓
- ✓
-
-
-
-

* - 5.1
* - 4.10 to 5.1
- ⊛
- ✓
- ✓
Expand All @@ -40,50 +32,3 @@
- ✓
- ✓
- ✓
-
-
-
-

* - 5.0
- ⊛
- ✓
- ✓
- ✓
- ✓
- ✓
- ✓
- ✓
-
-
-
-

* - 4.11
- ⊛
- ✓
- ✓
- ✓
- ✓
- ✓
- ✓
- ✓
-
-
-
-

* - 4.10
- ⊛
- ✓
- ✓
- ✓
- ✓
- ✓
- ✓
- ✓
-
-
-
-

4 changes: 4 additions & 0 deletions source/whats-new.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ improvements, and fixes:

:ref:`kotlin-search-indexes` in the Indexes guide

.. replacement:: vector-search-link

:ref:`kotlin-atlas-vector-search` in the Aggregates Builders guide

- Adds support for serializers from the ``kotlinx-datetime`` library
that let you map {+language+} date and time types to BSON as the
expected types instead of as strings. To learn more, see the
Expand Down

0 comments on commit 2e93b14

Please sign in to comment.