I'm trying to do a status update to a set of records in one collection where an ID exists in a different collection.
I cannot think how you would construct such a query, I believe I would add it into a finaAndModify function as shown below.
The jist of what I'm trying to do is:
SELECT records in db.raw_originBusinessData WHERE objectCycle_ID EXISTS in db.std_sourceBusinessData.
Here's the script which I am trying to complete, if findAndModify is the wrong method, please let me know, much appreciated.
db.std_sourceBusinessData.findAndModify({
query: { ? },
update: { $objectStatus: { $literal: "PROCESSED" } },
})