This came up while investigating PHPLIB test failures in the let spec tests (see: DRIVERS-2270). We observed test failures in PHPLIB's test runner due to outgoing update commands including explicit false values for multi and upsert because spec tests did not use $$unsetOrMatches; however, the same spec tests raised no error in CDRIVER-4198, which suggested a libmongoc issue.
test_check_event in runner.c calls entity_map_match for command and reply documents with allow_extra as true. It doesn't looked like bson_matcher_match in bson-match.c switches over to not allowing extra fields in embedded documents, and instead applies the incoming allow_extra field to all recursive calls. This conflicts with Allowing Extra Fields in Root-level Documents from the unified spec.
- duplicates
-
CDRIVER-4374 Only allow extra fields when matching root documents in unified spec tests
- Closed
- is related to
-
PHPLIB-748 Support 'let' option for multiple CRUD commands
- Closed
-
CDRIVER-4198 Support 'let' option for multiple CRUD commands
- Closed
-
DRIVERS-2270 Use $$unsetOrMatches for upsert and multi in update command expectations
- Implementing
- related to
-
CDRIVER-4374 Only allow extra fields when matching root documents in unified spec tests
- Closed
-
CDRIVER-4330 Use $$unsetOrMatches for upsert and multi in update command expectations
- Backlog