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

Support bypassDocumentValidation

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.3.0-beta0
    • Component/s: None
    • Labels:
      None
    • Sprint:
      C Driver 2015Q2 sprint 8

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: