I have 2 collections (A and B) with ~70,000 documents each. If I were to compare A and B, 95% of documents would be the same, only 5% would be different. Structure of each document is completely identical in both A and B. A is a constant collection, B is a temporary collection. I want to merge B into A. If document from B exists in A --> update "dateLastSeen" field only. If document in B does NOT exist in A --> insert this document into A.
...I'm using a Python driver (if that matters).
What is the most efficient way of doing this? Thank you.