diff --git a/driver-api/src/commonMain/kotlin/MongoCollection.kt b/driver-api/src/commonMain/kotlin/MongoCollection.kt index 5e1731c1..1bced91b 100644 --- a/driver-api/src/commonMain/kotlin/MongoCollection.kt +++ b/driver-api/src/commonMain/kotlin/MongoCollection.kt @@ -91,7 +91,7 @@ interface MongoCollection : ObjectIdGenerator, /** * THe name of this collection. * - * The collection name must be unique within a single [database] (otherwise, the two instances refer to the same data). + * The collection name must be unique within a single [MongoDatabase] (otherwise, the two instances refer to the same data). * * - The name should begin with a letter or an underscore (`_`). * - The name cannot be empty. diff --git a/driver-coroutines/README.jvm.md b/driver-coroutines/README.jvm.md index f68120aa..188506fd 100644 --- a/driver-coroutines/README.jvm.md +++ b/driver-coroutines/README.jvm.md @@ -24,7 +24,6 @@ val database = client.getDatabase("my_project") val collection = database.getCollection("users").asKtMongo() ``` -Note the call to [`asKtMongo()`][opensavvy.ktmongo.coroutines.asKtMongo] which is the only difference from the official usage. -From then on, all methods from this driver are available on the `collection` variable: see [MongoCollection][opensavvy.ktmongo.coroutines.MongoCollection]. +Note the call to [`asKtMongo()`][opensavvy.ktmongo.coroutines.asKtMongo] which is the only difference from the official usage. From then on, all methods from this driver are available on the `collection` variable: see [CoroutineMongoCollection][opensavvy.ktmongo.coroutines.CoroutineMongoCollection]. This means you are able to use KtMongo DSLs within your existing repositories: simply convert into a KtMongo equivalent where you need KtMongo functionality. diff --git a/driver-coroutines/README.md b/driver-coroutines/README.md index e920eb78..6f9b1853 100644 --- a/driver-coroutines/README.md +++ b/driver-coroutines/README.md @@ -39,7 +39,7 @@ dependencies { ## Basic usage -Once you have obtained an instance of [MongoCollection][opensavvy.ktmongo.coroutines.MongoCollection] (see platform-specific instructions on how to do this), you can use it to access the database: +Once you have obtained an instance of [CoroutineMongoCollection][opensavvy.ktmongo.coroutines.CoroutineMongoCollection] (see platform-specific instructions on how to do this), you can use it to access the database: ```kotlin class User( @@ -62,7 +62,7 @@ collection.update( ) ``` -[Learn more about the available operations][opensavvy.ktmongo.coroutines.MongoCollection]. +[Learn more about the available operations][opensavvy.ktmongo.coroutines.CoroutineMongoCollection]. # Package opensavvy.ktmongo.coroutines diff --git a/driver-coroutines/src/jvmMain/kotlin/CoroutineMongoAggregationPipeline.kt b/driver-coroutines/src/jvmMain/kotlin/CoroutineMongoAggregationPipeline.kt index a26eb8bf..367f14c4 100644 --- a/driver-coroutines/src/jvmMain/kotlin/CoroutineMongoAggregationPipeline.kt +++ b/driver-coroutines/src/jvmMain/kotlin/CoroutineMongoAggregationPipeline.kt @@ -20,6 +20,7 @@ package opensavvy.ktmongo.coroutines import opensavvy.ktmongo.api.MongoAggregationPipeline +import opensavvy.ktmongo.api.MongoIterable import opensavvy.ktmongo.dsl.LowLevelApi import opensavvy.ktmongo.dsl.aggregation.AccumulationOperators import opensavvy.ktmongo.dsl.aggregation.AggregationOperators diff --git a/driver-coroutines/src/jvmMain/kotlin/CoroutineMongoDatabase.kt b/driver-coroutines/src/jvmMain/kotlin/CoroutineMongoDatabase.kt index ce74bb05..c4906e44 100644 --- a/driver-coroutines/src/jvmMain/kotlin/CoroutineMongoDatabase.kt +++ b/driver-coroutines/src/jvmMain/kotlin/CoroutineMongoDatabase.kt @@ -33,7 +33,7 @@ import kotlin.reflect.typeOf * * ### What is a database? * - * [Collections][MongoCollection] are grouped into databases to avoid name collisions. + * [Collections][CoroutineMongoCollection] are grouped into databases to avoid name collisions. * Databases are similar to Kotlin packages. * If multiple applications are deployed in the same MongoDB instance in their own database, * they can use the same collection names (e.g. `users`) without conflicts. @@ -63,7 +63,7 @@ interface CoroutineMongoDatabase : MongoDatabase { override fun collection(name: String, type: KType): CoroutineMongoCollection /** - * Creates a [MongoCollection] object. + * Creates a [CoroutineMongoCollection] object. * * This method is purely a client-side operation, it does nothing in the MongoDB server. * In MongoDB, databases and collections are created implicitly on the first insert. diff --git a/driver-sync-java/README.md b/driver-sync-java/README.md index a018c5d3..dfea6d13 100644 --- a/driver-sync-java/README.md +++ b/driver-sync-java/README.md @@ -42,7 +42,7 @@ dependencies { Start by creating a `com.mongodb.client.MongoCollection` instance by following the instructions from the official Java driver. -Use the method [`KtMongo.from`][opensavvy.ktmongo.sync.KtMongo.from] to convert it into a KtMongo collection. +Use the method [`KtMongo.from`][opensavvy.ktmongo.sync.java.KtMongo.from] to convert it into a KtMongo collection. Because Java doesn't provide optional parameters, and because Java and Kotlin lambdas are slightly different, we offer convenience methods. @@ -54,4 +54,4 @@ collection.find(options(), filter(filter -> { You can find more complex examples in the [test directory](https://gitlab.com/opensavvy/ktmongo/-/tree/main/driver-sync-java/src/test/java/opensavvy/ktmongo/sync?ref_type=heads). -Java doesn't support operator overloading, so the `User::profile / Profile::name` syntax isn't possible. It is replaced by the [`JavaField`][opensavvy.ktmongo.sync.JavaField] class, which provides similar functionality. +Java doesn't support operator overloading, so the `User::profile / Profile::name` syntax isn't possible. It is replaced by the [`JavaField`][opensavvy.ktmongo.sync.java.JavaField] class, which provides similar functionality. diff --git a/driver-sync/README.jvm.md b/driver-sync/README.jvm.md index 8f55aeff..d666e639 100644 --- a/driver-sync/README.jvm.md +++ b/driver-sync/README.jvm.md @@ -24,7 +24,6 @@ val database = client.getDatabase("my_project") val collection = database.getCollection("users").asKtMongo() ``` -Note the call to [`asKtMongo()`][opensavvy.ktmongo.sync.asKtMongo] which is the only difference from the official usage. -From then on, all methods from this driver are available on the `collection` variable: see [MongoCollection][opensavvy.ktmongo.sync.MongoCollection]. +Note the call to [`asKtMongo()`][opensavvy.ktmongo.sync.asKtMongo] which is the only difference from the official usage. From then on, all methods from this driver are available on the `collection` variable: see [SyncMongoCollection][opensavvy.ktmongo.sync.SyncMongoCollection]. This means you are able to use KtMongo DSLs within your existing repositories: simply convert into a KtMongo equivalent where you need KtMongo functionality. diff --git a/driver-sync/README.md b/driver-sync/README.md index 11622f36..972092f6 100644 --- a/driver-sync/README.md +++ b/driver-sync/README.md @@ -39,7 +39,7 @@ dependencies { ## Basic usage -Once you have obtained an instance of [MongoCollection][opensavvy.ktmongo.sync.MongoCollection] (see platform-specific instructions on how to do this), you can use it to access the database: +Once you have obtained an instance of [SyncMongoCollection][opensavvy.ktmongo.sync.SyncMongoCollection] (see platform-specific instructions on how to do this), you can use it to access the database: ```kotlin class User( @@ -62,7 +62,7 @@ collection.update( ) ``` -[Learn more about the available operations][opensavvy.ktmongo.sync.MongoCollection]. +[Learn more about the available operations][opensavvy.ktmongo.sync.SyncMongoCollection]. # Package opensavvy.ktmongo.sync diff --git a/driver-sync/src/jvmMain/kotlin/SyncMongoAggregationPipeline.kt b/driver-sync/src/jvmMain/kotlin/SyncMongoAggregationPipeline.kt index b4b80feb..d042bd57 100644 --- a/driver-sync/src/jvmMain/kotlin/SyncMongoAggregationPipeline.kt +++ b/driver-sync/src/jvmMain/kotlin/SyncMongoAggregationPipeline.kt @@ -28,6 +28,7 @@ import opensavvy.ktmongo.dsl.options.SortOptionDsl import opensavvy.ktmongo.dsl.path.Field import opensavvy.ktmongo.dsl.query.FilterQuery import opensavvy.ktmongo.sync.api.MongoAggregationPipeline +import opensavvy.ktmongo.sync.api.MongoIterable import kotlin.reflect.KProperty1 import kotlin.reflect.KType import kotlin.reflect.typeOf diff --git a/driver-sync/src/jvmMain/kotlin/SyncMongoClient.kt b/driver-sync/src/jvmMain/kotlin/SyncMongoClient.kt index 89c966a2..a6c53f28 100644 --- a/driver-sync/src/jvmMain/kotlin/SyncMongoClient.kt +++ b/driver-sync/src/jvmMain/kotlin/SyncMongoClient.kt @@ -58,7 +58,7 @@ import opensavvy.ktmongo.sync.api.MongoClient * } * ``` * - * @see asKtMongoLegacy Convert an existing instance from the official Kotlin driver. + * @see asKtMongo Convert an existing instance from the official Kotlin driver. */ interface SyncMongoClient : MongoClient { diff --git a/driver-sync/src/jvmMain/kotlin/SyncMongoCollection.kt b/driver-sync/src/jvmMain/kotlin/SyncMongoCollection.kt index 34e11762..c643d769 100644 --- a/driver-sync/src/jvmMain/kotlin/SyncMongoCollection.kt +++ b/driver-sync/src/jvmMain/kotlin/SyncMongoCollection.kt @@ -40,9 +40,9 @@ import opensavvy.ktmongo.sync.api.operations.UpdateOperations * - Kotlin collections, like [List] and [Set], the embed an arbitrary number of items. * - Polymorphism, for example with `sealed class`, to have different fields based on a discriminator. * - * To avoid name collisions, collections are grouped into [databases][MongoDatabase]. + * To avoid name collisions, collections are grouped into [databases][SyncMongoDatabase]. * - * To obtain a collection, see [MongoDatabase.collection]. + * To obtain a collection, see [SyncMongoDatabase.collection]. * * ### Size limit * @@ -59,7 +59,7 @@ import opensavvy.ktmongo.sync.api.operations.UpdateOperations * - [Official documentation](https://www.mongodb.com/docs/manual/core/databases-and-collections/) * - [Size limits](https://www.mongodb.com/docs/manual/reference/limits/#bson-documents) * - * @see asKtMongoLegacy Convert an existing instance from the official Kotlin driver. + * @see asKtMongo Convert an existing instance from the official Kotlin driver. */ interface SyncMongoCollection : MongoCollection { diff --git a/driver-sync/src/jvmMain/kotlin/SyncMongoDatabase.kt b/driver-sync/src/jvmMain/kotlin/SyncMongoDatabase.kt index b8daeff2..6cfa3766 100644 --- a/driver-sync/src/jvmMain/kotlin/SyncMongoDatabase.kt +++ b/driver-sync/src/jvmMain/kotlin/SyncMongoDatabase.kt @@ -32,7 +32,7 @@ import kotlin.reflect.typeOf * * ### What is a database? * - * [Collections][MongoCollection] are grouped into databases to avoid name collisions. + * [Collections][SyncMongoCollection] are grouped into databases to avoid name collisions. * Databases are similar to Kotlin packages. * If multiple applications are deployed in the same MongoDB instance in their own database, * they can use the same collection names (e.g. `users`) without conflicts. @@ -41,7 +41,7 @@ import kotlin.reflect.typeOf * * ### Access * - * To obtain a database, see [MongoClient.database]. + * To obtain a database, see [SyncMongoClient.database]. * * To obtain a collection, see [collection]. * @@ -49,7 +49,7 @@ import kotlin.reflect.typeOf * * - [Official documentation](https://www.mongodb.com/docs/manual/core/databases-and-collections/) * - * @see asKtMongoLegacy Convert an existing instance from the official Kotlin driver. + * @see asKtMongo Convert an existing instance from the official Kotlin driver. */ interface SyncMongoDatabase : MongoDatabase { @@ -62,12 +62,12 @@ interface SyncMongoDatabase : MongoDatabase { override fun collection(name: String, type: KType): SyncMongoCollection /** - * Creates a [MongoCollection] object. + * Creates a [SyncMongoCollection] object. * * This method is purely a client-side operation, it does nothing in the MongoDB server. * In MongoDB, databases and collections are created implicitly on the first insert. * - * For an example, see [MongoClient]. + * For an example, see [SyncMongoClient]. */ @OptIn(LowLevelApi::class) @Suppress("WRONG_MODIFIER_CONTAINING_DECLARATION") diff --git a/driver-sync/src/jvmMain/kotlin/SyncMongoIterable.kt b/driver-sync/src/jvmMain/kotlin/SyncMongoIterable.kt index c9b0a875..9fbecedf 100644 --- a/driver-sync/src/jvmMain/kotlin/SyncMongoIterable.kt +++ b/driver-sync/src/jvmMain/kotlin/SyncMongoIterable.kt @@ -28,7 +28,7 @@ import com.mongodb.kotlin.client.FindIterable * The Coroutine client provides a coroutine-aware API which internally uses the * [official Kotlin driver](https://www.mongodb.com/docs/drivers/kotlin/coroutine/current/). * - * This type wraps a [FindFlow] from the official driver. + * This type wraps a [FindIterable] from the official driver. * See also [SyncMongoAggregateIterable]. * * ### External resources @@ -50,7 +50,7 @@ interface SyncMongoFindIterable : opensavvy.ktmongo.sync.api.Mon * The Coroutine client provides a coroutine-aware API which internally uses the * [official Kotlin driver](https://www.mongodb.com/docs/drivers/kotlin/coroutine/current/). * - * This type wraps a [AggregateFlow] from the official driver. + * This type wraps an [AggregateIterable] from the official driver. * See also [SyncMongoFindIterable]. * * ### External resources