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

Change mongocxx::options setters to return a self reference

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.2
    • Component/s: Implementation
    • Labels:
    • Sprint:
      Platforms 13 (04/22/16), Platforms 16 (06/24/16)

      Description

      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).

        Attachments

          Activity

            People

            Assignee:
            acm Andrew Morrow
            Reporter:
            alb@neptunesystems.com Allan Bazinet
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: