Postgres Aggregate Into Array In Javascript Example