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

Support bypassDocumentValidation

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.0-beta0
    • Affects Version/s: 1.2.0
    • Component/s: None
    • None

      Added new mongoc_bulk_write_flags_t "flags" which replaces the existing "ordered" field in the mongoc_bulk_operation_t (private) struct.

      This new struct contains various "bulk write" (e.g. "command write API") options.
      Currently these options are:

      • ordered (bool)
      • bypass_document_validation (enum)
      typedef enum
      {
         MONGOC_BYPASS_DOCUMENT_VALIDATION_FALSE   = 0,
         MONGOC_BYPASS_DOCUMENT_VALIDATION_TRUE    = 1 << 0,
         MONGOC_BYPASS_DOCUMENT_VALIDATION_DEFAULT = 1 << 1,
      } mongoc_write_bypass_document_validation_t;
      
      struct _mongoc_bulk_write_flags_t
      {
         bool ordered;
         mongoc_write_bypass_document_validation_t bypass_document_validation;
      };
      

      Added new functions:

      mongoc_bulk_operation_set_bypass_document_validation (mongoc_bulk_operation_t *bulk, bool bypass);
      mongoc_bulk_operation_set_flags (mongoc_bulk_write_operation_t *bulk, mongoc_bulk_write_flags_t flags);
      

      When creating a new mongoc_bulk_write_flags_t it SHOULD be initialized using the MONGOC_BULK_WRITE_FLAGS_INIT macro like so:

      mongoc_bulk_write_flags_t write_flags = MONGOC_BULK_WRITE_FLAGS_INIT;
      

      Which initializes the flags as

      ordered = true;
      bypass_document_validation = server default;
      

      When user explicitly passes bypass_document_validation it will be sent to the server – irregardless of its wire protocol version.

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            rathi.gnanasekaran Rathi Gnanasekaran
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: