Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCSP-43826: v5.2 release #175

Merged
merged 7 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Confirming that these should be capitalized

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not part of this PR, but you can also remove MongoDB columns for v3.4 and earlier

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
- ✓
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
Loading