aggregate method of MongoTemplate returns AggregationResults<T>, where T being the class that corresponds to mongo collection.
Sometimes, we only want the single (say property abc) or a couple of properties (pqr and xyz) from that collection depending on particular criteria. In these cases, we can either retrieve the whole collection into T class or create a new class that contains properties (abc) or (pqr, xyz).
Is there a way to map these single property to List<String> or two properties as a key-value pair in HashMap<String, String>?