Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Latest commit

 

History

History
51 lines (37 loc) · 1.04 KB

File metadata and controls

51 lines (37 loc) · 1.04 KB

jongo

{{jongo}} query in Java as in Mongo shell.

NOTE: This module depends on: mongodb driver module.

exports

  • {{jongo}} instances to a default database

  • JongoFactory to use alternative databases.

<dependency>
  <groupId>org.jooby</groupId>
  <artifactId>jooby-jongo</artifactId>
  <version>{{version}}</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.