skip to Main Content

Mongodb – optimize mongo query to get max date in a very short time

I'm using the query bellow to get max date (field named extractionDate) in a collection called KPI, and since I'm only interested in the field extractionDate: @Override public Mono<DBObject> getLastExtractionDate(MatchOperation matchOperation,ProjectionOperation projectionOperation) { return Mono.from(mongoTemplate.aggregate( newAggregation( matchOperation, projectionOperation, group().max(EXTRACTION_DATE).as("result"), project().andExclude("_id")…

VIEW QUESTION

Azure – How to return the list of Roles that the user has?

I followed the article, https://learn.microsoft.com/en-us/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-active-directory and created an App role The below endpoint uses users role to authorize @CrossOrigin(origins = "http://localhost:8080") @RestController @RequestMapping("/api") public class TutorialController { @Autowired TutorialRepository tutorialRepository; @PreAuthorize("hasAnyAuthority('APPROLE_Admin', 'APPROLE_Contributor')") @GetMapping("/tutorials") public ResponseEntity<List<Tutorial>> getAllTutorials(@RequestParam(required = false) String title)…

VIEW QUESTION
Back To Top
Search