Friday, 8 May 2020

Wanting to know if I can even perform this type of "upsert" in mongoose/mongo

Hi,Long story short, I'm trying to make a cron job to fetch a product catalog from a third party product catalog and store it in my own internal databse. I use the id field from each of these products and add it as an external id in my own database. I want to be able to pull from this catalog about once a week and update my database, is there some sort of update or upsert that can take that whole entire collection and update it based on the external id and if it doesn't exist, then insert it? I've seen updatemany, but I want the condition to be for each respective id for each product in the catalog.

Submitted May 09, 2020 at 02:51AM by wastedtimez

No comments:

Post a Comment