Skip to content

Commit 2afa435

Browse files
nkolosnjajiodrotbohm
authored andcommitted
GH-369 - Prefer MongoTemplate.findAndModify(…) over ….updateFirst(…).
Original pull request: GH-380.
1 parent b4bb541 commit 2afa435

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-modulith-events/spring-modulith-events-mongodb/src/main/java/org/springframework/modulith/events/mongodb/MongoDbEventPublicationRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public void markCompleted(Object event, PublicationTargetIdentifier identifier,
8989

9090
var update = Update.update(COMPLETION_DATE, completionDate);
9191

92-
mongoTemplate.updateFirst(byEventAndListenerId(event, identifier), update, MongoDbEventPublication.class);
92+
mongoTemplate.findAndModify(byEventAndListenerId(event, identifier), update, MongoDbEventPublication.class);
9393
}
9494

9595
/*

0 commit comments

Comments
 (0)