Skip to content

Commit

Permalink
Merge 7935105 into 1375cdd
Browse files Browse the repository at this point in the history
  • Loading branch information
lesteryou committed Jun 9, 2020
2 parents 1375cdd + 7935105 commit fa2dc8c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -106,6 +106,12 @@ $capsule->getDatabaseManager()->extend('mongodb', function($config, $name) {
return new Jenssegers\Mongodb\Connection($config);
});
```
Add a param `use_collections` in config array.
```php
$mongoConfig = [
'use_collections' => true,
];
```

Testing
-------
Expand Down
3 changes: 1 addition & 2 deletions src/Jenssegers/Mongodb/Query/Builder.php
Expand Up @@ -149,8 +149,7 @@ protected function shouldUseCollections()
$version = filter_var(explode(')', $version)[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); // lumen
return version_compare($version, '5.3', '>=');
}

return true;
return (bool) $this->connection->getConfig('use_collections') ?: false;
}

/**
Expand Down

0 comments on commit fa2dc8c

Please sign in to comment.