method
Value.CopyDocument
Copy a populated document for editing or interoperability.
Example
author, populated := page.Values["author"].CopyDocument()
if populated {
fmt.Println(author.ID)
}Returns
A detached document and true when populated; otherwise an empty document and false.
(Document, bool)How it works
Metadata and field maps are copied. Child Values remain immutable.
Full signature
func (value Value) CopyDocument() (
Document,
bool,
)