Skip to content

Commit

Permalink
always add version to query to use indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic authored Mar 12, 2017
1 parent a70c6e9 commit 7f7996d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Aggregate/AggregateRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ public function getAggregateRoot(string $aggregateId)
Operator::EQUALS(),
$aggregateId
);
$metadataMatcher = $metadataMatcher->withMetadataMatch(
'_aggregate_version',
Operator::GREATER_THAN_EQUALS(),
1
);

try {
$streamEvents = $this->eventStore->load($streamName, 1, null, $metadataMatcher);
Expand Down

0 comments on commit 7f7996d

Please sign in to comment.