tiaguinho / mongodb-cakephp3

An Mongodb datasource for CakePHP 3.0
MIT License
28 stars 29 forks source link

Getting default Database connection always #10

Closed basantk closed 7 years ago

basantk commented 7 years ago

i have two or more Datasources connection i wan a connection from default to other and test datasource for mongo only. so how can i do that. and i want to work with mysql and mongo db both.

tiaguinho commented 7 years ago

Inside your initialize method, set the name of the connection you want. Will be like this

public function initialize(array $config) {
    $config['connection'] = "myconnection";
    parent::initialize($config);
}
basantk commented 7 years ago

Thanks

basantk commented 7 years ago

how can i use aggregation in momgoDB like

tiaguinho commented 7 years ago

This was not implemented yet.