Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1991

replaceOne() also returns the replacement document?

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.3, 3.4.0
    • Affects Version/s: 3.2.5
    • Component/s: None
    • Labels:

      I've just noticed that a call to replaceOne() also includes in the updateWriteOpResult the replacement document, in the undocumented ops array.

      Is this intended? For large replacement documents, this could be a performance problem.
      Also, this behavior becomes identical to findOneAndReplace() called with returnOriginal: false. My expectation was that replaceOne() did not return the replaced or replacement document.

      In any case, it would help to document the ops array.

            Assignee:
            daniel.aprahamian@mongodb.com Daniel Aprahamian (Inactive)
            Reporter:
            dandv Dan Dascalescu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: