Details
-
Task
-
Resolution: Done
-
Minor - P4
-
None
-
None
-
None
Description
Is there a way to create a copy of an existing document without pulling out the document to the application. Currently this is what we are doing:
1) Read the existing document.
2) Apply some changes (change a field)
3) Save this document as a new document. (The original document stays the same)
Since our documents can be big, so we were wondering if we can do this:
1) Call some function with a document id and the fields we want to change.
2) On the mongo server side, the document is read, changed and a new document is created.
This way we are hoping to avoid pulling the document out of the mongo to the application. We think we can gain some performance out of it.
Is this supported? (Maybe through a javascript function).
If its possible then is this approach recommended?
Can you suggest something different that might be a better solution?