-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: 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
- is related to
-
CDRIVER-954 Deprecate mongoc_matcher_t
- Closed