I’m trying to build a multifunctional search method using MongoTemplate, Query and Criteria. Here is my RequestMapping for variable search: I want to be able to search lastName with multiple request parameters. For example, I want to find everyone with lastname “Smith” and “JohnsonR…
Tag: mongotemplate
Mongo DB Aggregation with Count for Specific Conditions and filter by Date Range which Outputs a Projection Doesn’t work as Expected
Please consider that I’m a beginner to MongoDB and I need to retrieve data from MongoDB database in somewhat complex query format. I’ve referred several Questions and Answers published in the community but my expected query was much complex due to some complex counts operations for certain conditi…
Spring boot aggregation with group Trim
Consider collection with whitespace in field, in DB if there is white space if we group them “Ravi”, ” Ravi ” , consider as total 2 values. but it should consider as single value. So I have trim in Group. I had performed in DB. But I don’t know how can I trim and group value in S…
Aggregation with multiple criteria
I want to perform aggregation using multiple criteria. The problem is that I don’t know how to pass multiple criteria. Do I declare multiple Match operation like below? And if yes, then how do I pass them to the aggregation method? I thought that it should be possible to create a MatchOperation that adh…