[GODRIVER-30] Implement MGO API Created: 26/May/17 Updated: 17/Jul/20 Resolved: 17/Jul/20 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Administrative Commands, CRUD |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Craig Wilson | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Epic Link: | mgo migration tool | ||||||||
| Comments |
| Comment by David Bartley [ 06/Apr/19 ] |
|
I can understand the reasoning around the second point, though I'm not sure that users of the go driver would necessarily care about the distinction? As a compromise, could Find do the same thing as RunCommand and FindOne with SingleResult, and pre-set the Cursor error? That way users can write less verbose code, and for anyone that does care about the distinction (i.e. they want to know find failed vs some subsequent getMore) they have the option of checking the return of Find itself? |
| Comment by David Bartley [ 06/Apr/19 ] |
|
Ah, I see ("If there was an error from the operation that created this SingleResult then the error will be returned."). It might be worth adding something to the godoc for "Err" to clarify that you'd only need to call that method if you didn't care about the output? |
| Comment by Kristofer Brandow (Inactive) [ 05/Apr/19 ] |
|
To your second point, bartle, during the design process we decided that an error to create a cursor was a different category of error from an error with the cursor itself, which is why they are two different errors (this is similar to why Decode provides it's own error, separate from Cursor). To your third point, I'm not sure what you mean. RunCommand only returns returns a mongo.SingleResult, on which you can call Decode. The Err method on mongo.SingleResult should only be used if you don't want to do anything with the resulting document and only want the error. The RunCommandCursor method returns a Cursor and an error, but that's to align with the reasoning above. |
| Comment by Scott L'Hommedieu (Inactive) [ 02/Apr/19 ] |
|
Added this new issue based on the first bullet from bartle |
| Comment by David Bartley [ 22/Mar/19 ] |
|
We recently tried to migrate from mgo to mongo-go-driver and discovered a few sharp edges/usability problems.
|
| Comment by Mihai B [ 12/Jul/18 ] |
|
It's worth to note that the "official" API is near unusable due the lack of documentation and abuse of interface{}. |