Im using insertMany to batchInsert from a CSV. The main problem im getting is that when it fails due to unique index, it does not discriminate (or at least i can find it) from failed ids and actually inserted. There is a list of "insertedIds" but it lists all ids.
Is this a feature or am i doing something wrong?
Is there a workaround?
I have already tried changing the options using
{ordered:false, rawResult: false}
Its actually nothing very fancy, just a simple insertMany, but it will fail (im counting on it) with duplicate index.
this.insertMany(chunck, {ordered:false, rawResult: false}, ( err, docs ) => {
if (err) {
console.log(err.result);
}
else {
console.log(docs);
}
Thanks!