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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • API, Documentation
    • None
    • Any

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: