As of 0.20.0, ParadeDB has migrated to a new SQL syntax. The old syntax is still supported and we have preserved the legacy docs here.
0.20.0
Count the number of values in a field
SELECT pdb.agg('{"value_count": {"field": "rating"}}') FROM mock_items WHERE id @@@ pdb.all();
agg ----------------- {"value": 41.0} (1 row)
COUNT
SET paradedb.enable_aggregate_custom_scan TO on;
SELECT COUNT(rating) FROM mock_items WHERE id @@@ pdb.all();
COUNT(*)
SELECT COUNT(*) FROM mock_items WHERE id @@@ pdb.all();
Was this page helpful?