Skip to content

Commit 7bd1f57

Browse files
authored
Updated Mongodb\Config docs
1 parent 757fa99 commit 7bd1f57

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/examples/mongodb.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,25 @@
1313
*/
1414

1515
use Phpfastcache\CacheManager;
16+
use Phpfastcache\Drivers\Mongodb\Config;
1617

1718
// Include composer autoloader
1819
require __DIR__ . '/../../vendor/autoload.php';
1920

20-
$InstanceCache = CacheManager::getInstance('mongodb', [
21+
$InstanceCache = CacheManager::getInstance('mongodb', new Config([
2122
'host' => '127.0.0.1',
22-
'port' => '27017',
23+
'port' => 27017,
2324
'username' => '',
2425
'password' => '',
25-
'timeout' => '1',
26+
'timeout' => 1,
2627
/**
2728
* These ones are
2829
* totally optional
2930
*/
3031
// 'collectionName' => 'Cache',
3132
// 'databaseName' => 'phpFastCache'
3233

33-
]);
34+
]));
3435

3536

3637
/**

0 commit comments

Comments
 (0)