Reputation: 180
Trying to start Grails 3.0.1 app using only mongodb. The mongo plugin does not seem to be reading the mongo config in the application.yml file. I've putting it in the environments development section, outside the environments section, etc. but it just uses default config of localhost:27017 and db name of 'test'.
here is the current config:
// default application.yml stuff
environments:
development:
grails:
mongo:
host: 'ip_address_here'
port: 27017
databaseName: 'app_dev'
test:
// rest of application.yml stuff
As a test, in the BootStrap I dumped out the grailsApplication.config data and the mongo stuff does appear there, so it is getting loaded.
Upvotes: 3
Views: 1136
Reputation: 359
Documentation might be little confusing, this should do the trick with auth
connectionString: "mongodb://myUserName:myPassword@ipOfServer:portOfServer/dbName"
Upvotes: 0
Reputation: 148
Here is the configuration that works for me with
Grails 3.0.1 org.grails.plugins:mongodb:4.0.0
environments:
development:
grails:
mongodb:
connectionString: "mongodb://127.0.0.1/test"
autoConnectRetry: true
connectTimeout: 0
maxWaitTime: 120000
socketTimeout: 0
socketKeepAlive: false
writeNumer: 0
writeTimeout: 0
writeFsync: false
dataSource:
dbCreate: create-drop
Upvotes: 3
Reputation: 46
Look here for all configuration options. Note especially "mongodb" instead of just "mongo"
Upvotes: 2