Hi I have looked around and am currently going over the docs but wanted to ask.
I’m trying to avoid duplicate entries into by db. My application crawls the web and returns arrays of objects which when I use the insertMany() function. updates my db with all the objects with new id’s generated as Id like, but the problem is when the crawl run again it’ll return a “new” array of objects which will likely be identical to the last one. Using insert as I have will create duplicate entries. I tried using updateMany with upsert: true but it wont accept my array of objects in the same way. I can do a single object which then has the array of objects but that’s not desirable
How can I pass in many objects at once using upsert like with insert([{},{}.{}]) creating new id’s for objects that don’t exist and updating existing ones?
Wondering am I better off storing the value in some variable to use as a filter to check new arrays coming in. and just use insertMany()?