{"id":15759600,"url":"https://github.com/cedrickring/reactor-mongodb","last_synced_at":"2025-03-31T09:11:41.886Z","repository":{"id":131057456,"uuid":"135805278","full_name":"cedrickring/reactor-mongodb","owner":"cedrickring","description":"A wrapper built upon the mongodb-async api with Reactor (http://projectreactor.io/)","archived":false,"fork":false,"pushed_at":"2018-07-09T18:58:33.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-06T13:32:11.716Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cedrickring.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-02T09:36:59.000Z","updated_at":"2021-12-27T00:10:09.000Z","dependencies_parsed_at":"2024-01-16T04:00:15.349Z","dependency_job_id":null,"html_url":"https://github.com/cedrickring/reactor-mongodb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedrickring%2Freactor-mongodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedrickring%2Freactor-mongodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedrickring%2Freactor-mongodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedrickring%2Freactor-mongodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cedrickring","download_url":"https://codeload.github.com/cedrickring/reactor-mongodb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246443538,"owners_count":20778249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-04T10:21:47.301Z","updated_at":"2025-03-31T09:11:41.867Z","avatar_url":"https://github.com/cedrickring.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reactor MongoDB\nA wrapper built upon the mongodb-async api with Reactor (http://projectreactor.io/) written in Kotlin, but fully compatible\nwith Java (due to `@JvmOverloads`).\n\n## Dependencies\n\n* `org.mongodb::mongodb-driver-async`\n* `io.projectreactor::reactor-core`\n\n## Maven\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.cedrickring\u003c/groupId\u003e\n    \u003cartifactId\u003ereactor-mongodb\u003c/artifactId\u003e\n    \u003cversion\u003e1.7\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## Example Usage\n\nJava:\n```java\nReactiveMongoClient client = ReactiveMongoClient.fromURI(\"mongodb://\u003cURL\u003e\");\nReactiveDatabase database = client.getDatabase(\"\u003cname\u003e\"); //get a reactive database\n\n//To get a collection, use\nReactiveCollection\u003cDocument\u003e collection = database.getCollection(\"\u003cname\u003e\");\n\n//or with a specific type\nReactiveCollection\u003cMyType\u003e collection = database.getCollection(\"\u003cname\u003e\");\n\n//you can also use factory methods known from MongoCollection\ncollection.withWriteConcern(...).withCodecRegistry(...);\n\n//To find documents in a collection, use\nFlux\u003cDocument\u003e documents = collection.find(Filters.eq(\"name\", \"John\"));\n\n//then subscribe to it\ndocuments.subscribe(document -\u003e document.getString(\"name\"));\n\n//or use other functions from Flux\ndocuments.map(document -\u003e document.getString(\"name\")).subscribe(...);\n```\n\nKotlin:\n```kotlin\nval client = ReactiveMongoClient.fromURI(\"mongodb://\u003cURL\u003e\")\nval database = client.getDatabase(\"name\")\n\n//in Kotlin we have some useful methods to avoid usage of T::class.java\nval collection = database.collection\u003cType\u003e(\"\u003cname\u003e\")\n\n//find documents of a specific type\nval find: Flux\u003cType\u003e = collection.findWithType\u003cType\u003e(Filters.eq(\"my\", \"filter\"))\n\n//or without a specified type\nval find: Flux\u003cDocument\u003e = collection.find(...)\n\n//then just subscribe to it\nfind.subscribe { println(it) }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedrickring%2Freactor-mongodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedrickring%2Freactor-mongodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedrickring%2Freactor-mongodb/lists"}