Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2998

Refactor _has_out_key to only inspect last pipeline stage

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor - P4 Minor - P4
    • 1.16.0
    • None
    • libmongoc

    Description

      _has_out_key() currently returns true if any pipeline stage is $out. Since $out can only be used in the last position (server will error otherwise), we can optimize this function to only inspect the final stage.

      There should be no negative effects to this change. If $out is used in the middle of a pipeline, libmongoc would then decide not to inherit a write concern and the server would ultimately return an error for a malformed pipeline.

      Attachments

        Activity

          People

            isabel.atkinson@mongodb.com Isabel Atkinson
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: