Upsert ("update + insert") là một tùy chọn của lệnh update, vd updateOne(filter, update, { upsert: true }).
Cơ chế: nếu có document khớp filter → update nó; nếu không có → insert một document mới ghép từ giá trị trong filter và các toán tử update. Rất tiện cho đồng bộ dữ liệu hoặc tăng/đếm counter ("nếu chưa có thì tạo, có rồi thì cộng dồn").