[CDRIVER-2998] Refactor _has_out_key to only inspect last pipeline stage Created: 07/Mar/19 Updated: 28/Oct/23 Resolved: 20/Aug/19 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | 1.16.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Jeremy Mikola | Assignee: | Isabel Atkinson |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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. |
| Comments |
| Comment by Githook User [ 20/Aug/19 ] |
|
Author: {'username': 'isabelatkinson', 'email': 'isabelatkinson@gmail.com', 'name': 'isabelatkinson'}Message: |