Skip to content
De Sokil edited this page Aug 17, 2016 · 6 revisions

Create YAML config file:

database1:
  collection1:
    lock: OPTIMISTIC
    documentClass: \Vendor\Entity\Document1
  collection2:
    documentClass: \Vendor\Entity\Document2
  "*": # any other not configured class
    documentClass: \Vendor\Entity\CommonDocument

Now you can configure client:

use Sokil\Mongo\Client;
$client = new Client();
$client->map(yaml_parse_file('/path/to/config.yaml'));
Clone this wiki locally