Js Add To Array If Exists Postgresql Version