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

Driver should validate BSON documents before insert and update

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.6.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Currently libmongoc's bulk write API does not validate BSON keys in documents when doing update/insert.

      No keys starting with "$" or containing ".":

      • mongoc_collection_insert - tested in test_insert
      • mongoc_collection_insert_bulk - test_insert_bulk
      • mongoc_bulk_operation_insert - test_insert_check_keys
      • mongoc_collection_save - test_save
      • "document" param to mongoc_bulk_operation_replace_one - test_replace_one_check_keys
      • "document" param to mongoc_bulk_operation_replace_one_with_opts - test_replace_one_with_opts_check_keys

      All keys must start with "$":

      • "document" param to mongoc_bulk_operation_update - test_update_check_keys
      • "document" param to mongoc_bulk_operation_update_many_with_opts - test_update_many_with_opts_check_keys
      • "document" param to mongoc_bulk_operation_update_one - test_update_one_check_keys
      • "document" param to mongoc_bulk_operation_update_one_with_opts - test_update_one_with_opts_check_keys

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            rathi.gnanasekaran Rathi Gnanasekaran
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: