Remove _id if use_dbref=False and val is a Document, to prevent modification of the original document.