0

I want to get a count of different Designation of Persons from a table. For Eg, 5 managers, 2 HR, 3 coordinates,etc. The below query gives me a total count of entries in UserDesig field. I want to have total count of different designations in the field like 5 for managers and so on. How will I accompalish this using projection queries?

 Template.Criteria.CreateCriteria("User")
                        .SetProjection(
                        Projections.ProjectionList()
                        .Add(Projections.Count("UserDesig"), "UserCount"));
developer
  • 5,178
  • 11
  • 47
  • 72

1 Answers1

0

try investigating Projections.GroupProperty(...)

Felice Pollano
  • 32,832
  • 9
  • 75
  • 115