Change mongocxx::options setters to return a self reference

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Done
    • Priority: Minor - P4
    • 3.0.2
    • Affects Version/s: 3.0.0
    • Component/s: Implementation
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The return value of a model::replace_one::upsert is a self-reference, allowing for fluid usage:

      replace_one& upsert(bool upsert);

      While the return value of an options::update is void:

      void upsert(bool upsert);

      It'd be nice to have the options object also return a self-reference to allow for inline, ephemeral usage where one is only using the options to request an upsert, which would reduce what's now a 3-line call (declare options, set upsert flag, pass to collection::replace_one() to a one-liner (just do it all inline in the collection::replace_one).

              Assignee:
              Andrew Morrow (Inactive)
              Reporter:
              Allan Bazinet
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: