Postgresql Get Index Of Array Javascript Function Parameters