replacing a document now expects a metadata aware entity