Uploaded image for project: 'Swift Driver'
  1. Swift Driver
  2. SWIFT-707

Update README Find Documents example with Result<Success, Failure> API

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      As the next() function now returns a Result() containing the generic Codable `T` or an error, the README example for finding documents must be updated to reflect this.

      let query: Document = ["a": 1]
      let documents = try collection.find(query)
      // .get() will return the .success value of the Result<>, or throw an error.
      for d in documents { print(try d.get()) }
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            ali.mir Ali Mir
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: