DB Connection example updated to use env

parent 4249c5ed
...@@ -79,11 +79,11 @@ And add a new mongodb connection: ...@@ -79,11 +79,11 @@ And add a new mongodb connection:
```php ```php
'mongodb' => array( 'mongodb' => array(
'driver' => 'mongodb', 'driver' => 'mongodb',
'host' => 'localhost', 'host' => env('DB_HOST', 'localhost'),
'port' => 27017, 'port' => env('DB_PORT', 27017),
'username' => 'username', 'database' => env('DB_DATABASE', ''),
'password' => 'password', 'username' => env('DB_USERNAME', ''),
'database' => 'database', 'password' => env('DB_PASSWORD', ''),
'options' => array( 'options' => array(
'db' => 'admin' // sets the authentication database required by mongo 3 'db' => 'admin' // sets the authentication database required by mongo 3
) )
...@@ -96,10 +96,10 @@ You can connect to multiple servers or replica sets with the following configura ...@@ -96,10 +96,10 @@ You can connect to multiple servers or replica sets with the following configura
'mongodb' => array( 'mongodb' => array(
'driver' => 'mongodb', 'driver' => 'mongodb',
'host' => array('server1', 'server2'), 'host' => array('server1', 'server2'),
'port' => 27017, 'port' => env('DB_PORT', 27017),
'username' => 'username', 'database' => env('DB_DATABASE', ''),
'password' => 'password', 'username' => env('DB_USERNAME', ''),
'database' => 'database', 'password' => env('DB_PASSWORD', ''),
'options' => array('replicaSet' => 'replicaSetName') 'options' => array('replicaSet' => 'replicaSetName')
), ),
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment