This project is intended to demonstrate Micronaut MongoDB support in Intellij IDEA.
The gutter next to class name navigates to corresponding collection:
There are gutters for entity properties to navigate to collection fields:
JSON language dialect is injected into Micronaut MongoDB query annotations with parameters and operators highlighting:
Entity fields and available operators are completed inside queries:
-
Open the
Services
tool window and pullmongo
docker image -
Right-click on the pulled image and select
Create container
-
Set a name for new container and bind ports
-
Run the created container
-
Add MongoDB datasource
-
Setup connection
-
Open DB console and create database with
use mnbooks
-
Create a collection with
db.createCollection("book")
-
Fulfill database with data from
db.js
The connection is configured in the application.yml
file:
mongodb.uri: mongodb://${MONGO_HOST:localhost}:${MONGO_PORT:27017}/mnbooks
There are few endpoints available to test the application: