Deleting the duplicate entries in a collection type

I do not have a solid example for custom import feature, but what I have suggested you was a logical explanation.

When you import the data for the first time, they will be saved in a collection with record details.
When you reimport the data again, you have to check whether the row exists in particular collection or not by using
let recordExists = strapi.db.query(‘api::collection-name.collection-name’).findOne({
where: { id: $row[‘id’] }
})
If the query finds an existing record, you have to update that particular record and if it doesn’t exists then create a new one.

I hope this explanation would be clear to you.