mongodb - Correct mongo database is not picked up from the connection parameter, instead have to map it manually -
i having issue need manually map correct database domain instead of being picked connection argument. using grails 3.2.8, plugin "org.grails.plugins:mongodb:6.1.0". have both hibernate , mongodb plugin enabled.
i have define connection url as
//application.yml mongodb: url: 'mongodb://${mongodb_username}:${mongodb_password}@${mongodb_replica_set}/${mongodb_database}?${mongodb_connection_options}'
my domain object defined :
class reportdata { string id long somefield static mapwith = "mongo" static mapping = { //database "db-name" doesn't work when commenting out line } }
shouldn't database(system property mongodb_database) picked auto-magically connection url? not sure if bug or missing configuration aspect.
i realized had not added following in build.gradle file:
bootrun { systemproperties = system.properties }
so application environment settings not getting applied correctly , hence connection url invalid.
i found detail here: http://docs.grails.org/latest/guide/conf.html
Comments
Post a Comment