[GODRIVER-776] Passing "nil" as a filter Created: 21/Jan/19 Updated: 29/Jan/19 Resolved: 28/Jan/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Documentation |
| Affects Version/s: | 0.2.0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Donald Casson | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating system:macOS Mojave ver 10.14.2 |
||
| Issue Links: |
|
||||||||
| Description |
|
All the documentation and examples given describe a nil type can be passed as a parameter however when doing so the output is:
The error comes from a call to collection.Find()
collection.Find() passes the filter value downard to transformDocument() And subsequently it is checked and if the value is nil it is returned.
It would make sense to be able to pass a nil to filter to get all the results from a colleciton however passing an empty bson.D{} object works also.
|
| Comments |
| Comment by Dylan Parker [ 28/Jan/19 ] |
|
I've got a PR open on github that updates the readme. You can find here https://github.com/mongodb/mongo-go-driver/pull/134 |
| Comment by Ian Whalen (Inactive) [ 28/Jan/19 ] |
|
Yup, as per your last comment - dupe of |
| Comment by Donald Casson [ 21/Jan/19 ] |
|
Looks like this has already been picked up and the readme needs to be updated. |