Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fluidsonic/fluid-mongo
Kotlin coroutine support for MongoDB built on top of the official Reactive Streams Java Driver
https://github.com/fluidsonic/fluid-mongo
coroutines kotlin kotlin-coroutines mongodb
Last synced: about 1 month ago
JSON representation
Kotlin coroutine support for MongoDB built on top of the official Reactive Streams Java Driver
- Host: GitHub
- URL: https://github.com/fluidsonic/fluid-mongo
- Owner: fluidsonic
- License: apache-2.0
- Created: 2018-10-05T00:58:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-06-24T02:44:57.000Z (over 1 year ago)
- Last Synced: 2024-11-15T11:02:06.713Z (about 2 months ago)
- Topics: coroutines, kotlin, kotlin-coroutines, mongodb
- Language: Kotlin
- Homepage:
- Size: 519 KB
- Stars: 33
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
fluid-mongo
===========[![Maven Central](https://img.shields.io/maven-central/v/io.fluidsonic.mongo/fluid-mongo?label=Maven%20Central)](https://search.maven.org/artifact/io.fluidsonic.mongo/fluid-mongo)
[![Kotlin](https://img.shields.io/badge/Kotlin-1.8.22-blue.svg)](https://github.com/JetBrains/kotlin/releases/v1.8.22)
[![MongoDB](https://img.shields.io/badge/MongoDB-Reactive%20Streams%204.10.0-blue.svg)](https://github.com/mongodb/mongo-java-driver/releases/tag/r4.10.0)
[![#fluid-libraries Slack Channel](https://img.shields.io/badge/slack-%23fluid--libraries-543951.svg?label=Slack)](https://kotlinlang.slack.com/messages/C7UDFSVT2/)Kotlin coroutine support for MongoDB built on top of the
official [MongoDB Reactive Streams Java Driver](https://mongodb.github.io/mongo-java-driver/4.10/driver-reactive/).Installation
------------`build.gradle.kts`:
```kotlin
dependencies {
implementation("io.fluidsonic.mongo:fluid-mongo:1.7.0")
}
```Example
-------```kotlin
import io.fluidsonic.mongo.MongoClients
import org.bson.Documentsuspend fun main() {
val collection = MongoClients.create()
.getDatabase("test")
.getCollection("test")collection.insertOne(mapOf("hello" to "world")) // suspending call
collection.insertOne(mapOf("it's" to "so easy!")) // suspending callcollection.find().collect { document -> // Kotlin Flow
println(document)
}
}
```Output:
```
Document{{_id=5bb6b56f9cfa62686b5afc87, hello=world}}
Document{{_id=5bb6b56f9cfa62686b5afc88, it's=so easy!}}
```License
-------Apache 2.0
--------------------------
[![Awesome Kotlin](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin)