Document.prototype.$clone()
#11849
Labels
enhancement
This issue is a user-facing general improvement that doesn't fix a bug or add a new feature
new feature
This change adds new functionality, like a new method or class
Milestone
Prerequisites
🚀 Feature Proposal
doc.$clone()
should return a copy ofdoc
with:_doc
$__
So return a new doc with the same state (same
isNew
, populated state, change tracking state, etc.)Motivation
This has popped up a couple of times in user questions, for example: #10788 . This has also popped up in internal work. Most recently, in #11442
$clone()
would have been helpful because we could just create a clone of the document to handle that particular manually populated edge case, so we can ensure that we don't overwrite the document's existing$__.wasPopulated
.Example
No response
The text was updated successfully, but these errors were encountered: