Upsert means “update or insert”: if no document matches the filter, MongoDB inserts a new document (based on the update) instead of updating.