Postgresql Order By Array Position Javascript Compiler