Skip to content

Commit

Permalink
doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
zigzago committed Jul 26, 2023
1 parent 1360aa5 commit 4ee6939
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 18 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[![Gitter](https://badges.gitter.im/kmongoo/Lobby.svg)](https://gitter.im/kmongoo/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge)
# <span style="color:red">KMongo is now deprecated</span> : do not use it for a new project

<span style="color:red">Look at the [Deprecation notice](https://litote.org/kmongo)</span>

[![Gitter](https://badges.gitter.im/kmongoo/Lobby.svg)](https://gitter.im/kmongoo/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.litote.kmongo/kmongo/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.litote.kmongo/kmongo)
[![Apache2 license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
[![Build Status](https://api.travis-ci.com/Litote/kmongo.png)](https://app.travis-ci.com/github/Litote/kmongo)
Expand Down
31 changes: 31 additions & 0 deletions kmongo-kdoc/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
# <span style="color:red">Deprecation notice</span>

KMongo was created in *2016*, when there was no official MongoDb kotlin driver.

On *June 28, 2023*, a kotlin driver, whose development I was able to follow, was [made available by MongoDb](https://www.mongodb.com/developer/languages/kotlin/).

KMongo is therefore officially deprecated in favor of this driver. What does this mean concretely?

- If you are starting a new project, use the official kotlin driver. You will get support from the MongoDb team.

- If you have an existing project using KMongo, there's no rush to switch to the official driver: I'll maintain KMongo for several more years for my own projects.
But no more evolutions will be added.
You will therefore have to plan a migration from KMongo to the MongoDb driver within a few months/years.

## How to switch from KMongo to kotlin mongo driver ?

- The MongoDb kotlin driver supports "native" object mapping and also kotlinx-serialization.
If you use one of these two mappings in KMongo, the transition will therefore be relatively simple.
If you use jackson mapping, there will be a little more effort.

- The kotlin MongoDb driver has a synchronous version and a coroutine version.
If you are using one of these versions in KMongo, you should have no problem.

- The missing feature currently with the official kotlin driver is the construction of queries which is a [little less intuitive](https://docs-mongodbcom-staging.corp.mongodb.com/kotlin/docsworker-xlarge/docsp-29260-migrate/migrate-kmongo/).

However, you can still use KMongo's query system coupled with the official driver.
As I migrate my own projects, I plan to release an isolated utility library
that will simplify the transition from KMongo query system to the new kotlin driver.

Many thanks to the MongoDB team who are now giving kotlin the support it deserves!

# ![KMongo logo](assets/images/kmongo.png) **KMongo** - a Kotlin toolkit for Mongo

```kotlin
Expand Down
4 changes: 2 additions & 2 deletions kmongo-kdoc/docs/object-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ You just have to add the ```kmongo-id``` dependency in the frontend to compile.
<dependency>
<groupId>org.litote.kmongo</groupId>
<artifactId>kmongo-id</artifactId>
<version>4.9.0</version>
<version>4.10.0</version>
</dependency>
```

- or Gradle

```
compile 'org.litote.kmongo:kmongo-id:4.9.0'
compile 'org.litote.kmongo:kmongo-id:4.10.0'
```

#### Id <> Json Jackson serialization
Expand Down
30 changes: 15 additions & 15 deletions kmongo-kdoc/docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ If you don't know, start with the sync driver and add this dependency to your pr
<dependency>
<groupId>org.litote.kmongo</groupId>
<artifactId>kmongo</artifactId>
<version>4.9.0</version>
<version>4.10.0</version>
</dependency>
```

- or Gradle

*(Kotlin)*
```kotlin
implementation("org.litote.kmongo:kmongo:4.9.0")
implementation("org.litote.kmongo:kmongo:4.10.0")
```
*(Groovy)*
```groovy
implementation 'org.litote.kmongo:kmongo:4.9.0'
implementation 'org.litote.kmongo:kmongo:4.10.0'
```

> Starting from 4.0, minimum supported jvm is now 1.8 (was 1.6).
Expand All @@ -45,19 +45,19 @@ For the asynchronous driver, reactive streams style, [Kotlin Coroutines](https:/
<dependency>
<groupId>org.litote.kmongo</groupId>
<artifactId>kmongo-async</artifactId>
<version>4.9.0</version>
<version>4.10.0</version>
</dependency>
```

- or Gradle

*(Kotlin)*
```kotlin
implementation("org.litote.kmongo:kmongo-async:4.9.0")
implementation("org.litote.kmongo:kmongo-async:4.10.0")
```
*(Groovy)*
```groovy
implementation 'org.litote.kmongo:kmongo-async:4.9.0'
implementation 'org.litote.kmongo:kmongo-async:4.10.0'
```

#### Kotlin Coroutines
Expand All @@ -68,19 +68,19 @@ implementation 'org.litote.kmongo:kmongo-async:4.9.0'
<dependency>
<groupId>org.litote.kmongo</groupId>
<artifactId>kmongo-coroutine</artifactId>
<version>4.9.0</version>
<version>4.10.0</version>
</dependency>
```

- or Gradle (Kotlin)

*(Kotlin)*
```kotlin
implementation("org.litote.kmongo:kmongo-coroutine:4.9.0")
implementation("org.litote.kmongo:kmongo-coroutine:4.10.0")
```
*(Groovy)*
```groovy
implementation 'org.litote.kmongo:kmongo-coroutine:4.9.0'
implementation 'org.litote.kmongo:kmongo-coroutine:4.10.0'
```

#### Reactor
Expand All @@ -89,19 +89,19 @@ implementation 'org.litote.kmongo:kmongo-coroutine:4.9.0'
<dependency>
<groupId>org.litote.kmongo</groupId>
<artifactId>kmongo-reactor</artifactId>
<version>4.9.0</version>
<version>4.10.0</version>
</dependency>
```

- or Gradle

*(Kotlin)*
```kotlin
implementation("org.litote.kmongo:kmongo-reactor:4.9.0")
implementation("org.litote.kmongo:kmongo-reactor:4.10.0")
```
*(Groovy)*
```groovy
implementation 'org.litote.kmongo:kmongo-reactor:4.9.0'
implementation 'org.litote.kmongo:kmongo-reactor:4.10.0'
```

#### RxJava2
Expand All @@ -112,19 +112,19 @@ implementation 'org.litote.kmongo:kmongo-reactor:4.9.0'
<dependency>
<groupId>org.litote.kmongo</groupId>
<artifactId>kmongo-rxjava2</artifactId>
<version>4.9.0</version>
<version>4.10.0</version>
</dependency>
```

- or Gradle

*(Kotlin)*
```kotlin
implementation("org.litote.kmongo:kmongo-rxjava2:4.9.0")
implementation("org.litote.kmongo:kmongo-rxjava2:4.10.0")
```
*(Groovy)*
```groovy
implementation 'org.litote.kmongo:kmongo-rxjava2:4.9.0'
implementation 'org.litote.kmongo:kmongo-rxjava2:4.10.0'
```

## Object Mapping Engine
Expand Down

0 comments on commit 4ee6939

Please sign in to comment.