Spring Data MongoDB Queries | Criteria queries | @Query Annotation | Aggregation with MongoTemplate
ฝัง
- เผยแพร่เมื่อ 8 ก.ย. 2024
- You will learn querying documents with Query and Criteria classes, regular expressions using $regex, and aggregation with MongoTemplate.
My Top Playlists:
Spring Boot with Angular : • Spring Boot + Angular
Spring Boot with Docker & Docker Compose : • Spring Boot Docker & D...
Spring Boot with Kubernetes : • Spring Boot Docker Kub...
Spring Boot with AWS : • Spring Boot + AWS
Spring Boot with Azure : • Spring Boot Azure
Spring Data with Redis : • Spring Data with Redis
Spring Boot with Apache Kafka : • Apache kafka
Spring Boot with Resilience4J : • SpringBoot Resilience4j
Great Work 👍
Thank u for video, i feel you need to explain the use case whihc you want to demo in video,then end use(group by case was not clear.
wow u told lot many ,is there any complete list of when to use which, i felt it is small lecture, can u do big detailed lecture
Sure
thanku
I would like to understand how do I compare two fields in the document. Has anyone ever needed to do this type of comparison? I'm using the criteria.
criteria.add(Criteria.where("this.campoC == this.campoD"));
Query query = new Query();
List criteria = new ArrayList();
criteria.add(Criteria.where("campoA").is(123));
criteria.add(Criteria.where("campoB").is("N"));
criteria.add(Criteria.where("this.campoC == this.campoD")); //
@GetMapping("/")
List compareName(@PathVariable(value = "name") String name,@PathVariable(value = "name2") String name2){
Query query = new Query();
query.addCriteria(Criteria.where(name).elemMatch(Criteria.where(name)));
return mongoTemplate.find(query,EmployeeModel.class);
}
Please share the sample code for this tutorial.
Increase your volume please
How to write case insensitive query
Haven't seen any criteria queries...
explain update query
where is github link?
Can you please add this code into GitHub
Can we use @Query for update also ??
In Spring Data JPA, the @Query annotation is typically used for defining custom queries for reading data from the database. While it's not intended for update operations, you can achieve update functionality using @Query in combination with the @Modifying annotation.