Как подсчитать несколько полей в MongoDB с помощью MongoTemplate следующим образом: SQL:
select count(distinct field1), count(distinct field2), count(distinct field3), sum(field4) from collectionName