Skip to content
Advertisement

Tag: aggregation-framework

MongoDB Extract document

I have this Json: I would like to filter exclusive for paymentType.type equals “PILOT” and limits equals type equals “COMBAT_HOURS”. This is the result I would like to receive. How to extract the document to reach this result? Answer Query map paymentTypes if paymentType= PILOT, filter the limits to keep only the combat hours else null (we don’t want that

MongoDB Aggregation Pipeline – Count no of records that are matching a complex criteria – (Couldn’t find PersistentEntity for type java.lang.Object!)

I have documents with dynamic fields and I would need to find a count of matching records for a given complex query criteria Example Entity Example Data: Expected Query Criteria: Building such complex Criteria using $match would be too much of implementation, so I was trying to use SPEL evolution through $project like below: However, the above logic failing due

How to count array elements properly with multiple aggregation in Spring Data MongoDB?

I need to create advanced aggregation using Spring Data MongoDB having model like that: pom.xml Cities collection: Libraries collection: Books collection: Depending on the context of the user, I have to return cities with count of libraries and books in the city that can be filtered based on startsWith() or like() principle. Assuming that I have 2 libraries in one

Advertisement