[GODRIVER-238] Lookup should properly traverse Arrays Created: 13/Feb/18 Updated: 28/Oct/23 Resolved: 23/Feb/18 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 0.0.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kristofer Brandow (Inactive) | Assignee: | Samuel Rossi (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
The Document.Lookup method currently supports depth traversal. The implementation retrieves a document from an Array when it needs to traverse into a BSON Array, but the implementation of Arrays does not have the keys as numbered strings. Since we currently just slice the first element off when doing a traversal, we'll need to add an internal method to Array (such as lookupTraverse) that takes an integer as the first parameter and a variadic slice of strings for the second argument, this way we can continue to traverse. This does mean that quite a bit of Lookup will be duplicated. |
| Comments |
| Comment by Githook User [ 23/Feb/18 ] |
|
Author: {'email': 'saghmrossi@gmail.com', 'name': 'Saghm Rossi', 'username': 'saghm'}Message: Change-Id: I0c59b6d5df941b0d247e49b16c54b95fb1ff3b8a |
| Comment by Samuel Rossi (Inactive) [ 23/Feb/18 ] |
|
Code review url: https://review.gerrithub.io/c/401233/ |