allow `replace/3` to replace the entire document when given the
root path as pointer