Unverified Commit 2597f6d4 authored by Jeremy Mikola's avatar Jeremy Mikola Committed by GitHub
Browse files

CDRIVER-3895: Remove dots/dollars validation for insert/replace docs (#801)

* CDRIVER-3895: Update CRUD, transactions, and unified spec tests

Also replaces CRUD legacy/v2 tests with unified equivalents for CDRIVER-3960.

Synced with mongodb/specifications@a124e21be89cbfc78606725c6ed1fa00dc992777

* Skip unified CRUD tests related to CDRIVER-3630

* Ensure upsertedIds is always present in BulkWriteResult

* Allow array or document for updateOne/Many update arg

* Remove dot/dollar restrictions for insert/replace validation

This adds top-level key validation to _mongoc_validate_replace, similar to what existed in _mongoc_validate_update.

* Remove redundant replace doc validation for legacy updates

Replacement docs will already be validated by _mongoc_validate_replace before this function is reached.

This adds logic to ensure "q" and "u" documents are present, similar to what existed in _mongoc_write_command_delete_legacy.

* Test success and failure for legacy update code path

The failure code path is testing that arguments are still validated by mongoc-util.c, despite replacement validation being removed in a previous commit.

* Revert "Skip tests with dots and dollars in field names on 5.0+ (#795)"

This reverts commit bd014ee7

.

* Revise bulk and collection tests for allowing dots/dollars

Empty keys can be used as a reliable BSON validation error, since insert, replace, and update all specify BSON_VALIDATE_EMPTY_KEYS in their vflags. Error message expectations are adjusted accordingly.

An _id document with a dollar-prefixed key is also used as a reliable server-side validation error.

* Allow methods in bulk_op_append to fail so expectError can be evaluated

* Skip unified tests due to schema version and outstanding issues

Allow entire files to be skipped to preempt schema version errors.

* Ensure WC is set on database and collection entities

Co-authored-by: default avatarKevin Albertson <kevin.albertson@10gen.com>
parent a6b3d5e5
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment