Using mongodb in grails i am trying to get a hold of the database from a service in the same fashion as when connecting to it from a controller.
e.g
static mongo
def db = mongo.getDB("dbone")
this does not seem to work. Is there a way to get a hold of the database from within a service in some other fasion?
You’re using a ‘static’ variable which is incorrect. Try ‘def mongo’