Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-238

Lookup should properly traverse Arrays

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.0.2
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      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.

            Assignee:
            sam.rossi@mongodb.com Samuel Rossi (Inactive)
            Reporter:
            kris.brandow@mongodb.com Kristofer Brandow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: