[CDRIVER-2886] Aggregate command must be sent to a primary if it uses $out Created: 15/Nov/18 Updated: 28/Oct/23 Resolved: 08/Mar/19 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | libmongoc |
| Affects Version/s: | None |
| Fix Version/s: | 1.15.0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Rathi Gnanasekaran | Assignee: | Clyde Bazile III (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Description |
|
See |
| Comments |
| Comment by Githook User [ 08/Mar/19 ] |
|
Author: {'name': 'bazile-clyde', 'email': '34226620+bazile-clyde@users.noreply.github.com', 'username': 'bazile-clyde'}Message: |
| Comment by Kevin Albertson [ 28/Feb/19 ] |
|
mongoc_collection_aggregate is lazy. It won't actually send the aggregate command to the server until the returned cursor is iterated on the first time with mongoc_cursor_next. We select the server to run the initial aggregate command inside our cursor logic here: We likely need to indicate on the mongoc_cursor_t (perhaps with a boolean flag) that we need to use a primary. And then set that boolean flag in mongoc_cursor_aggregate if the pipeline has a $out stage. |