I would like to get a list of items from an external resource periodically and save them into a collection.
There are several possible solutions but they are not optimal, for example:
Delete the entire collection and save the new list of items
Get all items from the collection using "find({})" and use it to filter out existing items and save those that do not exist.
But a better solution will be to set a unique key and just do kind of "update or insert". Right now on saving items the unique key already exists I will get an error is there a way to do it at all?
**upsert won't do the work since it's updating all items with the same value so it's actually good for a single document only