When $addToSet Brought Down Our System: A Hard Lesson in MongoDB at Scale

MongoDB’s $addToSet operator promises simplicity: add a value to an array only if it’s not already there — no duplicates, no extra logic.