# Aggregate with GroupBy SDN

**URL:** <https://community.neo4j.com/t/aggregate-with-groupby-sdn/3886>\
**Category:** Spring Data Neo4j & Neo4j-OGM\
**Tags:** grouping, counts\
**Created:** [December 17, 2018, 10:30am UTC](https://community.neo4j.com/t/aggregate-with-groupby-sdn/3886 "2018-12-17T10:30:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![1708krishna](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/1708krishna/32/2291_2.png) [@1708krishna](https://community.neo4j.com/u/1708krishna)\
**Post date:** [December 17, 2018, 10:30am UTC](https://community.neo4j.com/t/aggregate-with-groupby-sdn/3886/1 "2018-12-17T10:30:02Z")

</div>

Is there anyway with which we can fetch the aggregates(like count) grouped by some property of the node without writing custom-query in the code using SDN/OGM.

Any help is appreciated. Thanks in advance.

---

<div class="post-metadata">

**Author:** ![gerrit.meier](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/gerrit.meier/32/27374_2.png) [@gerrit.meier](https://community.neo4j.com/u/gerrit.meier)\
**Post date:** [January 30, 2019, 1:28pm UTC](https://community.neo4j.com/t/aggregate-with-groupby-sdn/3886/3 "2019-01-30T13:28:30Z")

</div>

Hi, since Cypher does not have any `groupBy` capability we do not offer anything out-of-the-box for grouping entities. The only, common way to achieve this is adding a `count(<groupProperty>)` to a custom query and parsing the result by yourself.  
The data in the same "row" should get mapped by OGM in some form of collection if OGM knows about the domain classes you want to get.
