Docs Home → Develop Applications → MongoDB Drivers → Kotlin Coroutine
Migrate from KMongo
On this page
Overview
This page contains a high-level comparison of most of the ways the official MongoDB Kotlin and the community-developed KMongo driver differ. You can use this page to identify the changes you need to make to migrate from the deprecated KMongo driver to the official MongoDB Kotlin driver.
KMongo is a popular community-developed library for working with MongoDB from Kotlin applications. It is a wrapper around the Java driver that was created prior to the creation of the official Kotlin driver to serve the needs of the Kotlin community.
Important
As of July 2023, KMongo has been marked as deprecated.
The MongoDB Kotlin driver is the officially supported and maintained MongoDB driver for Kotlin. It is developed by the MongoDB team.
Although both drivers support synchronous and asynchronous operations, the examples on this page will use asynchronous coroutine-based operations.
Connect to MongoDB Cluster
Both drivers let you connect to and communicate with MongoDB clusters from a Kotlin application.
CRUD and Aggregation
Both drivers provide support for all MongoDB CRUD APIs and aggregation operations.
Construct Queries
Both drivers provide support for type-safe queries using property references.
Data Typing
Both drivers support the use of Kotlin data classes as well as the Document
class to
model the data stored in a MongoDB collection. The Document
class lets you model data represented in a MongoDB collection in a flexible format.
Data Serialization
Both drivers provide support for serializing and deserializing data objects in Kotlin to and from BSON.
Synchronous and Asynchronous Support
Both drivers support synchronous and asynchronous operations.
What Next?
Now that you have learned about the differences between KMongo and the MongoDB Kotlin driver, see the Quick Start to get started using the KMongo Kotlin driver.