jongo

jongo

Jongo query in Java as in Mongo shell.

NOTE: This module depends on: mongodb driver module.

exports

<dependency>
  <groupId>org.jooby</groupId>
  <artifactId>jooby-jongo</artifactId>
  <version>1.5.1</version>
</dependency>

usage

{
  use(new Mongodb());
  use(new Jongoby());

  get("/", req -> {
    Jongo jongo = require(Jongo.class);
    // work with jongo...
  });
}

Previous example will give you a Jongo instance connected to the default database, provided by the mongodb module.

Access to alternate database is provided via: JongoFactory.

{
  use(new Mongodb());
  use(new Jongoby());

  get("/", req -> {
    Jongo jongo = require(JongoFactory.class).get("alternate-db");
    // work with jongo...
  });
}

For more information, please visit the Jongo web site.