Skip to content

Commit 55c7e32

Browse files
committed
DOCSP-46446: v5.3 release
1 parent 6d35b20 commit 55c7e32

20 files changed

+262
-97
lines changed

config/redirects

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
define: prefix docs/drivers/kotlin/coroutine
22
define: base https://www.mongodb.com/${prefix}
3-
define: versions v4.10 v4.11 v5.0 v5.1 v5.2 master
3+
define: versions v4.10 v4.11 v5.0 v5.1 v5.2 v5.3 master
44

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

examples/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
kotlin.code.style=official
2-
kotlin_mongodb_version=5.2.0
2+
kotlin_mongodb_version=5.3.0

examples/src/test/kotlin/AggregatesBuilderTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import config.getConfig
3434
import kotlinx.coroutines.flow.firstOrNull
3535
import kotlinx.coroutines.flow.toList
3636
import kotlinx.coroutines.runBlocking
37+
import org.bson.BinaryVector
3738
import org.bson.Document
3839
import org.bson.codecs.pojo.annotations.BsonId
3940
import org.bson.types.ObjectId
@@ -970,7 +971,8 @@ class AggregatesBuilderTest {
970971
assertEquals(1, results.first().get("count", Document::class.java).get("lowerBound", java.lang.Long::class.java)?.toInt())
971972
}
972973

973-
/* NOTE: Test is not run by default. Vector search requires the creation of a vector search index on the collection before running.
974+
/* NOTE: Test is not run by default. Vector search requires the creation of
975+
a vector search index on the collection before running.
974976
*/
975977
@Ignore
976978
fun vectorSearchTest() = runBlocking {
@@ -979,7 +981,7 @@ class AggregatesBuilderTest {
979981
// :snippet-start: vector-search
980982
Aggregates.vectorSearch(
981983
SearchPath.fieldPath(MovieAlt::plotEmbedding.name),
982-
listOf(-0.0072121937, -0.030757688, -0.012945653),
984+
BinaryVector.floatVector(floatArrayOf(0.0001f, 1.12345f, 2.23456f, 3.34567f, 4.45678f)),
983985
"mflix_movies_embedding_index",
984986
1.toLong(),
985987
exactVectorSearchOptions().filter(Filters.gte(MovieAlt::year.name, 2016))

examples/src/test/kotlin/ChangeTest.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11

22
import com.mongodb.client.model.Filters
3+
import com.mongodb.client.model.ReplaceOptions
4+
import com.mongodb.client.model.Sorts
5+
import com.mongodb.client.model.UpdateOptions
36
import com.mongodb.client.model.Updates
47
import com.mongodb.kotlin.client.coroutine.MongoClient
58
import config.getConfig
@@ -63,6 +66,11 @@ internal class ChangeTest {
6366
println("Matched document count: $result.matchedCount")
6467
println("Modified document count: $result.modifiedCount")
6568
// :snippet-end:
69+
70+
// :snippet-start: update-one-options
71+
val opts = UpdateOptions().sort(Sorts.ascending(PaintOrder::color.name))
72+
// :snippet-end:
73+
6674
// Junit test for the above code
6775
assertEquals(1, result.modifiedCount)
6876
}
@@ -90,6 +98,11 @@ internal class ChangeTest {
9098
println("Matched document count: $result.matchedCount")
9199
println("Modified document count: $result.modifiedCount")
92100
// :snippet-end:
101+
102+
// :snippet-start: replace-one-options
103+
val opts = ReplaceOptions().sort(Sorts.ascending(PaintOrder::color.name))
104+
// :snippet-end:
105+
93106
// Junit test for the above code
94107
assertEquals(1, result.modifiedCount)
95108
}

snooty.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ toc_landing_pages = [
1212
"/fundamentals/builders",
1313
"/usage-examples",
1414
"/api-documentation",
15+
"/fundamentals/builders/aggregates",
1516
]
1617
sharedinclude_root = "https://raw.githubusercontent.com/10gen/docs-shared/main/"
1718

1819
[constants]
1920
driver = "kotlin"
2021
driver-short = "Kotlin driver"
2122
driver-long = "MongoDB Kotlin Driver"
22-
version = "5.2"
23-
full-version = "{+version+}.1"
23+
version = "5.3"
24+
full-version = "{+version+}.0"
2425
language = "Kotlin"
2526
mdb-server = "MongoDB server"
2627
kotlin-docs = "https://kotlinlang.org"
@@ -34,5 +35,5 @@ snappyVersion = "org.xerial.snappy:snappy-java:1.1.8.4"
3435
zstdVersion = "com.github.luben:zstd-jni:1.5.5-2"
3536
logbackVersion = "1.2.11"
3637
log4j2Version = "2.17.1"
37-
serializationVersion = "1.5.1"
38+
serializationVersion = "1.6.0"
3839
kotlinx-dt-version = "0.6.1"

source/examples/generated/AggregatesBuilderTest.snippet.vector-search.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Aggregates.vectorSearch(
22
SearchPath.fieldPath(MovieAlt::plotEmbedding.name),
3-
listOf(-0.0072121937, -0.030757688, -0.012945653),
3+
BinaryVector.floatVector(floatArrayOf(0.0001f, 1.12345f, 2.23456f, 3.34567f, 4.45678f)),
44
"mflix_movies_embedding_index",
55
1.toLong(),
66
exactVectorSearchOptions().filter(Filters.gte(MovieAlt::year.name, 2016))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
val opts = ReplaceOptions().sort(Sorts.ascending(PaintOrder::color.name))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
val opts = UpdateOptions().sort(Sorts.ascending(PaintOrder::color.name))

source/fundamentals.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Fundamentals
1414
Stable API </fundamentals/stable-api>
1515
Databases & Collections </fundamentals/databases-collections>
1616
Data Formats </fundamentals/data-formats>
17-
CRUD Operations /fundamentals/crud
17+
CRUD Operations </fundamentals/crud>
1818
Builders </fundamentals/builders>
1919
Aggregation </fundamentals/aggregation>
2020
Aggregation Expressions </fundamentals/aggregation-expression-operations>

source/fundamentals/builders/aggregates.txt

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ Aggregates Builders
1717
:depth: 2
1818
:class: singlecol
1919

20+
.. toctree::
21+
22+
Atlas Vector Search </fundamentals/builders/vector-search>
23+
2024
Overview
2125
--------
2226

@@ -904,46 +908,3 @@ aggregation stage:
904908

905909
Learn more about this helper from the
906910
`searchMeta() API documentation <{+api+}/apidocs/mongodb-driver-core/com/mongodb/client/model/Aggregates.html#searchMeta(com.mongodb.client.model.search.SearchCollector)>`__.
907-
908-
.. _kotlin-atlas-vector-search:
909-
910-
Atlas Vector Search
911-
-------------------
912-
913-
.. important::
914-
915-
To learn about which versions of MongoDB Atlas support this feature, see
916-
:atlas:`Limitations </atlas-vector-search/vector-search-stage/#limitations>`
917-
in the Atlas documentation.
918-
919-
Use the ``vectorSearch()`` method to create a :atlas:`$vectorSearch </atlas-vector-search/vector-search-stage/>`
920-
pipeline stage that specifies a **semantic search**. A semantic search is
921-
a type of search that locates pieces of information that are similar in meaning.
922-
923-
To use this feature when performing an aggregation on a collection, you
924-
must create a vector search index and index your vector embeddings. To
925-
learn how to set up search indexes in MongoDB Atlas, see :atlas:`How to
926-
Index Vector Embeddings for Vector Search
927-
</atlas-search/field-types/knn-vector/>` in the Atlas documentation.
928-
929-
The example in this section uses data modeled with the following Kotlin data class:
930-
931-
.. literalinclude:: /examples/generated/AggregatesBuilderTest.snippet.vector-search-data-class.kt
932-
:language: kotlin
933-
934-
This example shows how to build an aggregation pipeline that uses the
935-
``vectorSearch()`` method to perform an exact vector search with the following
936-
specifications:
937-
938-
- Searches ``plotEmbedding`` field values by using vector embeddings of a
939-
string value
940-
- Uses the ``mflix_movies_embedding_index`` vector search index
941-
- Returns 1 document
942-
- Filters for documents in which the ``year`` value is at least ``2016``
943-
944-
.. literalinclude:: /examples/generated/AggregatesBuilderTest.snippet.vector-search.kt
945-
:language: kotlin
946-
947-
To learn more about this helper, see the
948-
`vectorSearch() API documentation
949-
<{+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)>`__.

0 commit comments

Comments
 (0)