Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1428

InsertOneAsync use and documentation are incosistent

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 2.0, 2.0.1
    • Component/s: API
    • None
    • None
    • Major Change
    • None
    • None
    • None
    • None
    • None
    • None

      The implementation of the InsertOneAsync is not consistent with its documentation. The method signature of InsertOneAsync is listed as Task InsertOneAsync(..., and the documentation (both in the code and online) states:

      Return Value
      Type: Task
      The result of the insert operation.
      

      This is inconsistent with the previous version of the API as well as with the original mongo api, which both return a WriteResult (see this section of the tutorial). The importance of the WriteResult is that it includes an error message that can be logged to help diagnose the issue. With just the Task, there is not enough information to help determine why the insert had failed.

            Assignee:
            Unassigned Unassigned
            Reporter:
            pauldfaria Paul Faria
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: