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

Add a findOne method

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0-rc0
    • Component/s: None
    • Labels:

      Description

      We had a user ask if there was an API method to retrieve exactly one document. Right now there is not and you need to use a cursor with a limit of 1 and then read out the first result.
      We should consider adding findOne. This is permitted by the CRUD spec but not included in it:

       If your driver wishes to offer a findOne method, that is perfectly fine. If you choose to implement findOne, please keep to the naming conventions followed by the FindOptions and keep in mind that certain things don't make sense like limit (which should be -1), tailable, awaitData, etc...

        Attachments

          Activity

            People

            Assignee:
            ali.mir Ali Mir
            Reporter:
            kaitlin.mahar Kaitlin Mahar
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: