[GODRIVER-1116] Slice projection not working as expected Created: 07/Jun/19 Updated: 01/Jul/19 Resolved: 01/Jul/19 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Core API, CRUD |
| Affects Version/s: | 1.0.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Anindya Chatterjee | Assignee: | Run Tian Yu (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Ubuntu: 19.04 |
||
| Description |
|
$slice projection is not working as expected in the go driver. I am using below code to fetch 5 elements from the nested array.
The above code is returning all elements of product array instead of only 5.
|
| Comments |
| Comment by Run Tian Yu (Inactive) [ 11/Jun/19 ] |
|
Hi anidotnet, as per https://docs.mongodb.com/manual/reference/operator/projection/slice/, Projection should be formatted as https://github.com/mongodb/mongo-go-driver/blob/master/examples/documentation_examples/examples.go#L1303 |