Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2847

CLONE - RunCommandCursor always fails and returns an error message referencing internal driver details

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.13.0, 1.13.1
    • Affects Version/s: 1.11.6
    • Component/s: Command & Dispatch
    • None
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Example code:

      	_, err := client.Database("mydb").RunCommandCursor(nil, bson.D{
      		{"explain", bson.D{{"find", "mycollection"}}},
      		{"verbosity", "executionStats"},
      	})
      

      This simpler example fails in the same way:

      	_, err := client.Database("mydb").RunCommandCursor(nil, bson.D{
      		{"ping", 1},
      	})
      

      Error:

      cursor should be an embedded document but is of BSON type invalid
      

      It's quite possible that i'm just doing something wrong. In which, case the bug is just that the error message does not indicate what I did wrong. However, im pretty sure there's a real bug here preventing this from working.

      I see that `RunCommandCursor` calls `ResultCursor`, which calls `NewCursorResponse` with `c.result`. `c.result` only appears to ever be set by `Execute` which, is never called. `NewCursorResponse` then returns the above error when it tries to verify the type of the "cursor" field on a nil document.

            Assignee:
            matt.dale@mongodb.com Matt Dale
            Reporter:
            jacobtbills@gmail.com Jacob Bills
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: