Skip to content

Commit

Permalink
Revert incorrect change
Browse files Browse the repository at this point in the history
  • Loading branch information
totemcaf committed Dec 14, 2023
1 parent e0dce60 commit 872116c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eventstore/mongodb_v2/eventstore.go
Expand Up @@ -536,7 +536,7 @@ func (s *EventStore) loadFromCursor(ctx context.Context, id uuid.UUID, cursor *m
}

func (s *EventStore) LoadSnapshot(ctx context.Context, id uuid.UUID) (*eh.Snapshot, error) {
result := s.snapshots.FindOne(ctx, bson.M{"aggregate_id": id})
result := s.snapshots.FindOne(ctx, bson.M{"aggregate_id": id}, options.FindOne().SetSort(bson.M{"version": -1}))
if err := result.Err(); err != nil {
if errors.Is(err, mongo.ErrNoDocuments) {
return nil, nil
Expand Down

0 comments on commit 872116c

Please sign in to comment.