Skip to main content
The RETURN clause defines which properties and values the result-set will contain.

Basic Usage

The basic structure is a comma-separated list of alias.property expressions:
For convenience, you can specify just the alias to return all properties of an entity:

Removing Duplicates

Use the DISTINCT keyword to remove duplicate values from the result-set:
For example, if you have two friends (Joe and Miesha) who both know Dominick, DISTINCT ensures that Dominick appears only once in the final result set.

Aggregations

The RETURN clause can also aggregate data, similar to SQL’s GROUP BY functionality. When an aggregation function is used in the RETURN list, all non-aggregated values become implicit grouping keys:
This query groups data by movie title and, for each movie, returns the youngest and oldest actor ages.

Supported Aggregation Functions

For detailed information on aggregation functions, see the Functions documentation.

Frequently Asked Questions

Use RETURN DISTINCT followed by the expression or alias to eliminate duplicate rows from the result set.
FalkorDB uses implicit grouping. When an aggregation function (like count, sum, avg) appears in RETURN, all non-aggregated expressions automatically become grouping keys, similar to SQL GROUP BY.
Yes. Simply return the alias without a property accessor, e.g. RETURN movie. This returns the full entity including all labels and properties.
FalkorDB supports avg, collect, count, max, min, percentileCont, percentileDisc, stDev, and sum.