Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-545

Create document copies in a collection without pulling the document out

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Minor - P4 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?

      Attachments

        Activity

          People

            Unassigned Unassigned
            zarian.waheed@rms.com Zarian Waheed
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: