Skip to content

This project is intended to demonstrate Micronaut MongoDB support in Intellij IDEA

Notifications You must be signed in to change notification settings

dtsaryov/ij-mn-mongodb-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Micronaut MongoDB Sample

This project is intended to demonstrate Micronaut MongoDB support in Intellij IDEA.

Features

Gutter icon for entity to navigate to database

The gutter next to class name navigates to corresponding collection:

entity-gutter

Gutter icons for fields to navigate to entity fields

There are gutters for entity properties to navigate to collection fields:

property-gutters

JSON Injection for Query Annotations with Parameter Highlighting

JSON language dialect is injected into Micronaut MongoDB query annotations with parameters and operators highlighting:

json-injection

Entity Field and Operators Completion

Entity fields and available operators are completed inside queries:

fields and operators completion


Setup

Docker Container Setup

  1. Open the Services tool window and pull mongo docker image

    pull-docker-image

  2. Right-click on the pulled image and select Create container

    create-container

  3. Set a name for new container and bind ports

    setup-container

  4. Run the created container

MongoDB Setup

  1. Add MongoDB datasource

    add-mongodb-ds

  2. Setup connection

    setup mongodb connection

  3. Open DB console and create database with use mnbooks

    create db

  4. Create a collection with db.createCollection("book")

    create collection

  5. Fulfill database with data from db.js

    fulfill db

Setup App Connection with DB

The connection is configured in the application.yml file:

mongodb.uri: mongodb://${MONGO_HOST:localhost}:${MONGO_PORT:27017}/mnbooks

Application API

There are few endpoints available to test the application:

App API

About

This project is intended to demonstrate Micronaut MongoDB support in Intellij IDEA

Topics

Resources

Stars

Watchers

Forks