Inserting many documents in collection, but only unique elements, based on specific field
First add an unique constraint on field link.

db.collection.createIndex({"link": 1}, {unique: true})


And then without using insertMany, insert each document of the list using javscript functions.

Lastly remove the index(unique constraint) we no longer need.

db.collection.dropIndex("link_1") // or your index name