Skip to content

Latest commit

 

History

History
64 lines (48 loc) · 1.99 KB

File metadata and controls

64 lines (48 loc) · 1.99 KB

Installation

Installation using Grails

To get started with RxGORM for MongoDB in a Grails application simply add the following dependency to your build.gradle file:

build.gradle
implementation "org.grails.plugins:rx-mongodb:{version}"

Installation without Grails

If you are not developing a Grails application then define the following dependency in your build.gradle or pom.xml:

build.gradle
implementation "org.grails:grails-datastore-gorm-rx-mongodb:{version}"

With that done you will need to place the following logic in the bootstrap path of your application:

import org.grails.datastore.rx.mongodb.*
import com.mongodb.rx.client.MongoClient
...
MongoClient mongoClient = ... // create the MongoClient

new RxMongoDatastoreClient(
            mongoClient, // (1)
            "myDatabase", // (2)
            MyClass // (3)
)
  1. The MongoClient instance

  2. The name of the default database to save objects to

  3. One or many classes that implement RxEntity

The org.grails.datastore.rx.mongodb.RxMongoDatastoreClient class is required to initialize RxGORM for MongoDB.