fiskie/mongostash

MongoDB 驱动程序,用于 Stash。

1.0.4 2017-06-05 12:10 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:26:25 UTC


README

这是 Stash 的 MongoDB 驱动程序,支持 MongoClient 和新的 MongoDB 库。

这允许您使用持久化和分布式存储作为您的缓存驱动程序,这对于同质化和分布式系统来说可能非常理想。

使用方法

$mongo = new \MongoClient(); // Whatever it is you are doing to create your Mongo client instance

$pool = new \Stash\Pool(new \MongoStash\MongoDB([
    'mongo' => $mongo,
    'database' => 'local',
    'collection' => 'stash.store' // This is optional, stash.store is the default.
]));

现在您就可以开始使用了。