Postgresql Index Array Javascript