A PUT or POST request first deletes an exiting document and then recreates it with findAndModify() with upsert option. This leads to ghost deletes and one delete db operation overhead.
findAndModify() was preferred over findAndReplace() to allow update operators and dot notation.
allowing the update operators (with the exception of $currentDate) is useless, since the write operation is applied when the existing document has been already deleted;
the dot notation can be supported by RESTHeart unflattering the request body
the $currentDate operator can be suppoerted by RESTHeart replacing it with a BsonDateTime() object
Given that, we can use findAndReplace() command and avoid ghost deletes.