broadway/event-store-mongodb
最新稳定版本:0.5.0
Composer 安装命令:
composer require broadway/event-store-mongodb
包简介
A MongoDB EventStore implementation for Broadway.
README 文档
README
Installation:
Install package via composer
$ composer require broadway/event-store-mongodb
Configuration
Register the services
parameters: mongodb_host: localhost mongodb_port: 27107 mongodb_database: default services: broadway.event_store.mongodb_client: class: MongoDB\Client arguments: ['mongodb://%mongodb_host%:%mongodb_port%'] broadway.event_store.mongodb_collection: class: MongoDB\Collection factory: ['@broadway.event_store.mongodb_client', selectCollection] arguments: ['%mongodb_database%', 'events'] broadway.event_store.mongodb: class: Broadway\EventStore\MongoDB\MongoDBEventStore arguments: ['@broadway.event_store.mongodb_collection', '@broadway.serializer.payload', '@broadway.serializer.metadata']
Create index for events collection
db.getCollection('events').createIndex({'uuid': 1, 'playhead': 1},{'unique': 1});
Testing
For testing you need a running MongoDB instance. To start a local MongoDB you can use the provided docker-compose.yml:
docker-compose up -d
To run the tests:
./vendor/bin/phpunit
统计信息
- 总下载量: 28.49k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-23