Skip to content

Commit

Permalink
chore: change activity upsert to update
Browse files Browse the repository at this point in the history
QizhengMo committed Nov 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 21c5c57 commit da15bfd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -51,7 +51,7 @@ public Boolean pushUserActivity(String userName, Activity activity) {
Query query = Query.query(Criteria.where(UserDto.Fields.userName).is(userName));
Update update = MongoHelper.getUpdate();
update.push(UserDto.Fields.activities, UserMapper.INSTANCE.activityDaoFromDto(activity));
return mongoTemplate.upsert(query, update, UserCollection.class).getModifiedCount() > 0;
return mongoTemplate.findAndModify(query, update, UserCollection.class) != null;
}

@Override

0 comments on commit da15bfd

Please sign in to comment.