Here are the references for:
find_one_and_update
method
Finds a single document and updates it, returning either the original or the updated document.
update_one
method
Update a single document matching the filter.
It seems to me both of them first query the selected document, then update it.
I would like to know if there is some kind of optimization difference. The only other difference is in the return value, which makes me wonder why one would even use update_one()
at all.