GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - sepatel/KtMongo: The next MongoDB driver for Kotlin (mirror)

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

2,053 Commits
2,053 Commits

Folders and files

NameName
Last commit message
Last commit date
.devcontainer
.devcontainer
 
 
.gitlab/ci
.gitlab/ci
 
 
.idea
.idea
 
 
annotations
annotations
 
 
bson-multiplatform
bson-multiplatform
 
 
bson-official
bson-official
 
 
bson-tests
bson-tests
 
 
bson
bson
 
 
docker
docker
 
 
docs
docs
 
 
driver-api
driver-api
 
 
driver-coroutines-kmongo
driver-coroutines-kmongo
 
 
driver-coroutines
driver-coroutines
 
 
driver-multiplatform-wire
driver-multiplatform-wire
 
 
driver-multiplatform
driver-multiplatform
 
 
driver-shared-kmongo
driver-shared-kmongo
 
 
driver-shared-official
driver-shared-official
 
 
driver-sync-api-adapter
driver-sync-api-adapter
 
 
driver-sync-api
driver-sync-api
 
 
driver-sync-java
driver-sync-java
 
 
driver-sync-kmongo
driver-sync-kmongo
 
 
driver-sync
driver-sync
 
 
dsl-template
dsl-template
 
 
dsl
dsl
 
 
gradle
gradle
 
 
test-coroutines-kotlinx
test-coroutines-kotlinx
 
 
test-coroutines-reflection
test-coroutines-reflection
 
 
test-legacy
test-legacy
 
 
test-multiplatform
test-multiplatform
 
 
test-sync-kotlinx
test-sync-kotlinx
 
 
test-sync-reflection
test-sync-reflection
 
 
test
test
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.gitlab-ci.main.kts
.gitlab-ci.main.kts
 
 
.gitlab-ci.yml
.gitlab-ci.yml
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle.kts
build.gradle.kts
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
qodana.yaml
qodana.yaml
 
 
settings.gradle.kts
settings.gradle.kts
 
 

Repository files navigation

KtMongo: the next MongoDB driver for Kotlin

Pronounced "cat-mongo".

In 2016, Julien Buret created KMongo, a Kotlin driver for MongoDB, based on the official Java driver. KMongo added a lot of syntax sugar, making complex queries much more readable and less error-prone thanks to improved type safety:

// Official Java driver
Bson filter = and(eq("user.gender", "female"), gt("user.age", 29));
collection.find(filter);
class User(
	val gender: String,
	val age: Int,
)

class Document(
	val user: User,
)

// KMongo
collection.find(
	and(
		Document::user / User::gender eq "female",
		Document::user / User::age gt 29
	)
)

In 2023, MongoDB released an official Kotlin driver. Development of KMongo stopped, but the official driver lacked much of the syntax niceties of KMongo, as well as requiring major migration efforts. As a result, many projects decided to keep using KMongo for the foreseeable future.

We decided to take it upon ourselves to birth the future of MongoDB drivers for Kotlin. KtMongo is based on the official Kotlin driver to ensure we profit from security fixes and new features, and reimplements a DSL inspired by KMongo, taking the occasion to change the decisions we didn't like.

// KtMongo
collection.find {
	Document::user / User::gender eq "female"
	Document::user / User::age gt 29
}

This project is for everyone who works with KMongo and is worried about the future after the deprecation notice, as well as for everyone dissatisfied with the official Kotlin driver.

Read more in the documentation.

License

This project is licensed under the Apache 2.0 license. Individual files may have additional copyright holders.

The initial prototype was developed by 4SH, and is also licensed under the Apache 2.0 license, though with different copyright holders.

Mokodee, our precious mascot and logo, was created by Lilywhiteout.

Contributing

See CONTRIBUTING.md.

  • To learn more about our coding conventions and workflow, see the OpenSavvy website.
  • This project is based on the OpenSavvy Playground, a collection of preconfigured project templates.

If you don't want to clone this project on your machine, it is also available using DevContainer (open in VS Code • IntelliJ & JetBrains IDEs). Don't hesitate to create issues if you have problems getting the project up and running.

About

The next MongoDB driver for Kotlin (mirror)

ktmongo.opensavvy.dev

Resources

Readme
License

Contributing

Contributing
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.