skip to Main Content

Spring Data mongodb like query

I want to make a text search case insensitive with regex query with spring-data mongo . For example in SQL: SELECT * FROM Customers WHERE CustomerName LIKE 'a%'; How can i make this query with spring-data mongo using MongoRepository Query…

VIEW QUESTION

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
Back To Top
Search