My code inserts two times the same values from array (last one). Why ? How to insert many rows but only if they doesn't exists ?
for x of species # two elements 36 and 37
data = { movie_id : id, species_id : species[x].id }
console.log data
MovieSpecies.exists data, (err, exists) ->
if exists == false
MovieSpecies.create data, (err, items) ->
console.log items