From 73e4ad7b87828753d38a35343a2c128cab47a3f0 Mon Sep 17 00:00:00 2001 From: Celestino Amoroso Date: Wed, 3 Jun 2026 09:11:51 +0200 Subject: [PATCH] Expr.adoc/groupby: group keys are strings --- doc/Expr.adoc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/Expr.adoc b/doc/Expr.adoc index b7f1b08..3e7b484 100644 --- a/doc/Expr.adoc +++ b/doc/Expr.adoc @@ -1920,18 +1920,20 @@ Syntax: + The left side of [blue]`groupby` operator is a list ofdictionaries or an iterator over a list of dictionaries. It takes a key and returns a dictionary where the keys are the unique values of the specified key in the dictionaries and the values are lists of dictionaries that have that key value. In other words, it groups the dictionaries by the specified key value. +NOTE: Currently, keys of group are always strings. In the future, it will be possible to specify a key function to compute the keys of the groups. + .Examples `>>>` [blue]`[{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}, {"name": "Charlie", "age": 30}] groupby "age"` + -[source,json] +[source,yaml] ---- { - 25: [ + "25": [ { "name": "Bob", "age": 25 } ], - 30: [ + "30": [ { "name": "Alice", "age": 30