Standardize on :write_concern for write concern options

XMLWordPrintableJSON

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

      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 (Inactive)
            Reporter:
            Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: