[GODRIVER-909] Problem if filter in Distinct is nil Created: 28/Mar/19 Updated: 02/Apr/19 Resolved: 02/Apr/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | 1.0.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Robert Ressl | Assignee: | Kristofer Brandow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
There is a problem in the Distinct function. If the filter is nil, the distinct will not be executed:
As a workaround I have used a blank search request:
|
| Comments |
| Comment by Robert Ressl [ 29/Mar/19 ] |
|
Hi kris.brandow, Okay, thanks for the information. In the not stable driver, it was possible with nil. Yes, I receive an error: 'document is nil' Thanks, |
| Comment by Kristofer Brandow (Inactive) [ 28/Mar/19 ] |
|
Hi r.ressl, The mongo package's documentation states: "All Client, Collection, and Database methods that take parameters of type interface{} will return ErrNilDocument if nil is passed in for an interface{}", therefore nil is not a valid parameter for Distinct. Did you receive ErrNilDocument from the call to Distinct or another error? |
| Comment by Robert Ressl [ 28/Mar/19 ] |
|
go version go1.12.1 darwin/amd64 |