updateOne: chỉ sửa một phần document qua các toán tử như$set,$inc,$push. Field nào không nhắc tới thì giữ nguyên.replaceOne: thay toàn bộ nội dung document bằng document mới (vẫn giữ nguyên_id). Quên field nào là field đó mất.
Liên hệ HTTP cho dễ nhớ: updateOne giống PATCH (sửa vài field), replaceOne giống PUT (ghi đè toàn bộ).
updateOne: changes only part of a document via operators like$set,$inc,$push. Fields you don't mention stay as they are.replaceOne: replaces the entire document with a new one (keeping the same_id). Any field you omit is lost.
An HTTP analogy: updateOne is like PATCH (edit a few fields), replaceOne is like PUT (full overwrite).