Postgresql Get Index Of Element In Javascript0