fluid-mongo

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

License

License

GroupId

GroupId

com.github.fluidsonic
ArtifactId

ArtifactId

fluid-mongo
Last Version

Last Version

0.9.10
Release Date

Release Date

Type

Type

jar
Description

Description

fluid-mongo
Kotlin coroutine support for MongoDB built on top of the official MongoDB Asynchronous 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

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.fluidsonic/fluid-mongo/ -->
<dependency>
    <groupId>com.github.fluidsonic</groupId>
    <artifactId>fluid-mongo</artifactId>
    <version>0.9.10</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.fluidsonic/fluid-mongo/
implementation 'com.github.fluidsonic:fluid-mongo:0.9.10'
// https://jarcasting.com/artifacts/com.github.fluidsonic/fluid-mongo/
implementation ("com.github.fluidsonic:fluid-mongo:0.9.10")
'com.github.fluidsonic:fluid-mongo:jar:0.9.10'
<dependency org="com.github.fluidsonic" name="fluid-mongo" rev="0.9.10">
  <artifact name="fluid-mongo" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.fluidsonic', module='fluid-mongo', version='0.9.10')
)
libraryDependencies += "com.github.fluidsonic" % "fluid-mongo" % "0.9.10"
[com.github.fluidsonic/fluid-mongo "0.9.10"]

Dependencies

compile (3)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.3.50
org.jetbrains.kotlinx : kotlinx-coroutines-core jar 1.3.2
org.mongodb : mongodb-driver-core jar 3.11.1

runtime (1)

Group / Artifact Type Version
org.mongodb : mongodb-driver-async jar 3.11.1

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.0")
}

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
0.9.10
0.9.9
0.9.8
0.9.7
0.9.6
0.9.5
0.9.4
0.9.3
0.9.2
0.9.1