typedb / typedb-docs

TypeDB Documentation
25 stars 72 forks source link

Confusing documentation on "count" keyword #140

Closed BFergerson closed 5 years ago

BFergerson commented 5 years ago

The documentation for count states (https://dev.grakn.ai/docs/query/aggregate-query#count):

Optionally, count accepts a variable as an argument.

I thought this meant:

match $x isa thing;
get; count $x;

The above query causes the exception:

Exception in thread "main" java.lang.IllegalArgumentException: Aggregate COUNT does not accept a Variable

I believe the correct usage is:

match $x isa thing;
get $x; count;

I think it would be useful to make this more clear.

sorsaffari commented 5 years ago

You're absolutely right @BFergerson. The explanation on count aggregate function has been updated to reflect the 1.5.0 change.