Spring Boot Batch Procecssing CSV to MongoDB
#3 From MongoDB
@Bean
public MongoItemReader reader() {
MongoItemReader reader = new MongoItemReader<>();
reader.setTemplate(mongoTemplate);
reader.setSort(new HashMap<String, Sort.Direction>() {{
put("_id", Direction.DESC);
}});
reader.setTargetType(Employee.class);
reader.setQuery("{}");
return reader;
} \