I am trying to update a field name Date in collection-B from collection-A by comparing the articleid of both fields. if articelid id matches then the date will be inserted in the matching document of collection-B How will I update the date field?
I really do not know if it is the best or if the performance are any good.
What I like about the concept of doing it with merge rather than a $set update is that you can verify what will be updated by removing the $merge. This way the merge is like a commit. You can build your update incrementally and do the commit once you are happy.
thanks for this answer, but what if I need to match all articleid not only one article id [ means whatever articleid of collection-A matches with collection-B then update the field pubdate in collection-B from A]? also can I use it with a date range in collection-A? if yes please give a small example.
Oh that was my mistake totally a typo, I mean to say what if I need to match data from collection-A to collection-B, within a date range field - Date
How can I update the date field of collection-B from Collection-A by matching all articleid, if any article id matches then only a date will update in that matching document, also it will be helpful and quick if we can match within a date range of collection-A by using field date, i mean if we can select data within a date range in collection-A then start matching the articleid with collection-B and if any articleid matches of any document then only it will update the date in that document of collection-B from A