Postgres Json Array Functions Javascript