Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-881

Change mongocxx::options setters to return a self reference

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

      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@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            alb@neptunesystems.com Allan Bazinet
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: