fluid-mongo

Kotlin coroutine support for MongoDB built on top of the official Reactive Streams Java Driver

License

License

Categories

Categories

Data
GroupId

GroupId

io.fluidsonic.mongo
ArtifactId

ArtifactId

fluid-mongo-metadata
Last Version

Last Version

1.1.3
Release Date

Release Date

Type

Type

module
Description

Description

fluid-mongo
Kotlin coroutine support for MongoDB built on top of the official Reactive Streams Java Driver
Project URL

Project URL

https://github.com/fluidsonic/fluid-mongo
Source Code Management

Source Code Management

https://github.com/fluidsonic/fluid-mongo

Download fluid-mongo-metadata

Dependencies

compile (1)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib jar 1.4.10

Project Modules

There are no modules declared in this project.

fluid-mongo

Maven Central Kotlin MongoDB #fluid-libraries Slack Channel

Kotlin coroutine support for MongoDB built on top of the official MongoDB Reactive Streams Java Driver.

Installation

build.gradle.kts:

dependencies {
    implementation("io.fluidsonic.mongo:fluid-mongo:1.2.1")
}

Example

import io.fluidsonic.mongo.MongoClients
import org.bson.Document


suspend 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 call

    collection.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

Versions

Version
1.1.3
1.1.2
1.1.1