I'm using insertMany to insert documents collected from the spotify api, with the below structure:
{
spotify_id: "6400dnyeDyD2mIFHfkwHXN",
name: "Pablo Honey",
...
}
Using:
db.collection.insertMany(albums)
(where albums is an array containing objects of the above structure)
On subsequent calls the same operation runs, but I would like to only insert new documents, i.e not those where spotify_id
already exists in the database