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 occurrences over fixed time intervals
SELECT pdb.agg('{"date_histogram": {"field": "created_at", "fixed_interval": "30d"}}') FROM mock_items WHERE id @@@ pdb.all();
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- {"buckets": [{"key": 1679616000000.0, "doc_count": 14, "key_as_string": "2023-03-24T00:00:00Z"}, {"key": 1682208000000.0, "doc_count": 27, "key_as_string": "2023-04-23T00:00:00Z"}]} (1 row)
Was this page helpful?