Postgres Query Json Array Length Javascript