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

Documentation for mongocxx::collection::find_one doesn't specify what happens if the document isn't found

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: API, Documentation
    • Labels:
      None
    • Environment:
      Any

      The documentation for mongocxx::collection::find_one says that it throws a mongocxx::exception::query exception if the query fails. It's not clear whether failure is meant to include the case where no documents are returned. It appears that the actual behavior is to return an instance of the return type with the value set to nullopt. This needs to be described. An example of use would also be useful and welcome.

            Assignee:
            matt.cotter Matt Cotter
            Reporter:
            sdeerwester Scott Deerwester
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: