Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1860

Standardize on :write_concern for write concern options

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.10.0.rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible

      Currently database, collection and gridfs take write concern as :write option while session and operations take it as :write_concern option. This discrepancy is error-prone because lower level code does not error when given :write option, but silently behaves not as expected. Similarly collection will accept :write_concern and ignore it. Additionally we do not have great documentation explaining this difference.

      Since :write_concern seems to be a better name choice compared to :write, this ticket proposes to add :write_concern to collection and client options as an alternative to :write, so that applications can use :write_concern everywhere.

      Important points:

      • Client and collection will accept both :write and :write_concern.
      • If both are given together, their values must be identical or an exception will be raised.
      • Whatever option is given by the caller will be stored (i.e. at this point the driver will not replace the key name in options).

            Assignee:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: