Javascript Add String To Array If Not Exists In Postgresql