Skip to content

Commit 4656b83

Browse files
committed
fix bug
The main solution is to solve the bugs encountered in using database alone
1 parent 99bb77d commit 4656b83

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ The service provider will register a mongodb database extension with the origina
6161
For usage outside Laravel, check out the [Capsule manager](https://github.com/illuminate/database/blob/master/README.md) and add:
6262

6363
```php
64-
$capsule->getDatabaseManager()->extend('mongodb', function($config)
64+
$capsule->getDatabaseManager()->extend('mongodb', function($config, $name)
6565
{
66+
$config['name'] = $name;
67+
6668
return new Jenssegers\Mongodb\Connection($config);
6769
});
6870
```

src/Jenssegers/Mongodb/Query/Builder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ protected function shouldUseCollections()
152152
$version = filter_var(explode(')', $version)[0], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION); // lumen
153153
return version_compare($version, '5.3', '>=');
154154
}
155+
156+
return true;
155157
}
156158

157159
/**

0 commit comments

Comments
 (0)