[CDRIVER-4329] Do not permit extra fields when matching embedded documents in unified spec tests Created: 08/Apr/22  Updated: 02/May/22  Resolved: 02/May/22

Status: Closed
Project: C Driver
Component/s: libmongoc, tests
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Unknown
Reporter: Jeremy Mikola Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates CDRIVER-4374 Only allow extra fields when matching... Closed
Related
related to CDRIVER-4374 Only allow extra fields when matching... Closed
related to CDRIVER-4330 Use $$unsetOrMatches for upsert and m... Backlog
is related to PHPLIB-748 Support 'let' option for multiple CRU... Closed
is related to CDRIVER-4198 Support 'let' option for multiple CRU... Closed
is related to DRIVERS-2270 Use $$unsetOrMatches for upsert and m... Implementing

 Description   

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.



 Comments   
Comment by Jeremy Mikola [ 02/May/22 ]

This will be addressed by CDRIVER-4374, so resolving as a duplicate.

Generated at Wed Feb 07 21:20:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.