# Groupby on reference properties

**URL:** <https://forum.weaviate.io/t/groupby-on-reference-properties/1866>\
**Category:** Support\
**Created:** [April 1, 2024, 12:17pm UTC](https://forum.weaviate.io/t/groupby-on-reference-properties/1866 "2024-04-01T12:17:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![2020ashish](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/2020ashish/32/797_2.png) [@2020ashish](https://forum.weaviate.io/u/2020ashish)\
**Post date:** [April 1, 2024, 12:17pm UTC](https://forum.weaviate.io/t/groupby-on-reference-properties/1866/1 "2024-04-01T12:17:39Z")

</div>

### Description

Hey I’m try to fetch information using CrossRef pro  
class A { name, has\_add}  
class B { city, country}

Query: try to list down top 5 country where name is ‘josh’

### Server Setup Information

- Weaviate Server Version:  
Version 4

### Any additional Information

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [April 5, 2024, 7:10pm UTC](https://forum.weaviate.io/t/groupby-on-reference-properties/1866/2 "2024-04-05T19:10:39Z")

</div>

Hi! According to our docs:

> **[Aggregate | Weaviate - Vector Database](https://weaviate.io/developers/weaviate/api/graphql/aggregate#groupby-argument)**
>
> This page covers aggregation queries. They are collectively referred to as Aggregate queries within.

> - The `groupBy` `path` is limited to one property or cross-reference. Nested paths are not supported.

Let me know if this helps!

Thanks!

---

<div class="post-metadata">

**Author:** ![2020ashish](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/2020ashish/32/797_2.png) [@2020ashish](https://forum.weaviate.io/u/2020ashish)\
**Post date:** [April 6, 2024, 5:41pm UTC](https://forum.weaviate.io/t/groupby-on-reference-properties/1866/3 "2024-04-06T17:41:18Z")

</div>

Thanks @DudaNogueira ,  
I have already go though this document.  
However, I did’t found any example for “how to apply groupby on cross reference property”  
I want to know how to pass crossref path in groupby .  
In v3, it is easy such “has\_add{…on B {city}}”. There is no document which provide information on it.
