Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-701

Client-side array and document matching

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.1.6
    • Component/s: libmongoc
    • None
    • Environment:
      RHEL6

      Followon to CDRIVER-641

      Matcher_t does not seem to work for values as arrays. The docs may indicate it should (https://github.com/mongodb/mongo-c-driver/blob/58f9962777150d013101581a1e974620acf57696/doc/matcher.page#L11)?

      I'm running the latest (1.1.6) release

      Generate a doc/subdoc with string value

      >>> doc_str = {"base":{"subdoc":"value"}}

      Generate a doc/subdoc with string inside array

      >>> doc_arr = {"base":{"subdoc":["value"]}}

      Generate a valid mongo spec that should match on both documents

      >>> spec = {"base.subdoc":{"$in":["value", "some_other_value"]}}

      Generate the matcher

      >>> matcher = bc.generate_matcher(spec)

      Compare correctly against the first document

      >>> bc.match(matcher, doc_str)

      True

      Compares incorrectly against the second document.

      >>> bc.match(matcher, doc_arr)

      False

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            bauman Dan Bauman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: