Skip to content

Commit

Permalink
refactor: stream API 사용해서 filter 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
rlajm1203 committed Sep 16, 2024
1 parent fccc9f0 commit 90f40f7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void init() throws IOException, SQLException {
@Override
public void run(ApplicationArguments args) throws Exception {
try {
List<MongoAnswer> answers = answerAdaptor.findAll();
List<MongoAnswer> answers = answerAdaptor.findAll().stream().filter(answer -> answer.getApplicantState()==null).toList();
answers.forEach(MongoAnswer::stateEmptyCheckAndInit);
answerAdaptor.saveAll(answers);
log.info("MongoDB Applicant State Check를 완료했습니다.");
Expand Down

0 comments on commit 90f40f7

Please sign in to comment.