[GODRIVER-1605] Allow cursor options to be specified when using RunCommandCursor Created: 05/May/20 Updated: 28/Oct/23 Resolved: 23/Mar/23 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.12.0, 1.11.7 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Divjot Arora (Inactive) | Assignee: | Preston Vasquez |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Documentation Changes: | Not Needed | ||||||||||||||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||||||||||||||
| Description |
|
The Database.RunCommandCursor method doesn't allow users to specify cursor options that are part of getMore rather than the initial find/aggregate/etc. We should figure out how we can add this functionality without changing the API. One thought is to add them to options.RunCmdOptions and document that they only apply to RunCommandCursor. |
| Comments |
| Comment by Githook User [ 05/Jun/23 ] |
|
Author: {'name': 'Preston Vasquez', 'email': 'prestonvasquez@icloud.com', 'username': 'prestonvasquez'}Message: Co-authored-by: Matt Dale <9760375+matthewdale@users.noreply.github.com> |
| Comment by Githook User [ 23/Mar/23 ] |
|
Author: {'name': 'Preston Vasquez', 'email': 'prestonvasquez@icloud.com', 'username': 'prestonvasquez'}Message: Co-authored-by: Matt Dale <9760375+matthewdale@users.noreply.github.com> |
| Comment by Huan Li [ 13/Feb/23 ] |
|
esha.bhargava@mongodb.com We are not literally "blocked" by this feature. But a few of our recent replication failures were caused by the cursor timeout. With this new feature, we could largely avoid such failures. |
| Comment by Matt Dale [ 13/Feb/23 ] |
|
Some additional implement options: Get batch size from RunCommandCursor commandAnother way to implement this is to fetch the "batchSize" from the command document and use that as the "batchSize" option when we create the cursor. There are pros and cons to that approach: Pros:
Cons:
Add Cursor.SetBatchSizeA 3rd option is to add a function SetBatchSize to Cursor that allows setting batch size on a Cursor after creating it. Inspired by the Python driver API cursor.batch_size. Pros/cons: Pros:
Cons:
Compare to pros/cons of adding a BatchSize option to options.RunCmdOptions as suggested in the ticket description: Pros:
Cons:
|
| Comment by Huan Li [ 09/Feb/23 ] |
|
kevin.eric.albertson@gmail.com matt.dale@mongodb.com Can we reprioritize this ticket based on the discussion here? |