package Ġcom . mongodb . client . reactor . sample . kotlin . mic ronaut Ċ Ċ import Ġcom . mongodb . reactiv est ream s . client . Mongo Client Ċ import Ġcom . mongodb . reactor . client . Reactor Mongo Client Ċ import Ġcom . mongodb . reactor . client . Reactor Mongo Collection Ċ import Ġcom . mongodb . reactor . client . Reactor Mongo Database Ċ import Ġcom . mongodb . reactor . client . to Reactor Ċ import Ġjak arta . inject . Singleton Ċ import Ġreactor . core . publisher . Mono Ċ Ċ @ Singleton Ċ class ĠSample Service ( reactive Streams Client : ĠMongo Client ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġreactor Client : ĠRe actor Mongo Client Ġ= Ġreactive Streams Client . to Reactor () ĊĊĠĠĠ Ġ// Ġor Ġprivate Ġval Ġreactor Db Ġ= Ġreactive Streams Client . get Database (" test "). to Reactor () ĊĠĠĠ Ġprivate Ġval Ġreactor Db : ĠRe actor Mongo Database Ġ= Ġreactor Client . get Database (" test ") ĊĊĠĠĠ Ġ// Ġor Ġprivate Ġval Ġreactor Collection Ġ= Ġreactive Streams Client . get Database (" test "). get Collection (" users ", ĠUser :: class . java ). to Reactor () ĊĠĠĠ Ġprivate Ġval Ġreactor Collection : ĠRe actor Mongo Collection < User > Ġ= Ġreactor Db . get Collection (" users ", ĠUser :: class . java ) ĊĊĠĠĠ Ġfun Ġlist Databases Names () Ġ= Ġreactor Client . list Database Names () ĊĊĠĠĠ Ġfun Ġlist Collections () Ġ= Ġreactor Db . list Collection Names () ĊĊĠĠĠ Ġfun ĠfindAll () Ġ= Ġreactor Collection . find () ĊĊĠĠĠ Ġfun Ġcreate ( user : ĠUser ): ĠMono < User > Ġ= Ġreactor Collection . insert One ( user ). thenReturn ( user ) Ċ } Ċ