(Quick Reference)

3 Mongo Entities - Reference Documentation

Authors: Juri Kuehn

Version: 0.8.0

3 Mongo Entities

Creating Mongo Entities

Classes that should be mapped to MongoDB should be put into the /grails-app/mongo directory. You can also use the create-mongodb-class command to generate mongo classes.

> grails create-mongodb-class Car

Classes that should be mapped have to be put into the grails-app/mongo directory or have to be annotated with the com.google.code.morphia.annotations.Entity annotation.

Dependency Injection

Mapped MongoDB entities are autowired as described in the Grails user guide

class Car {

def mongo // autowired by spring def someService // autowired by spring

}