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

Document should not conform to ExpressibleByArrayLiteral

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.2.0
    • Component/s: None
    • Labels:

      Description

      Currently, Document conforms to ExpressibleByArrayLiteral. Doing something like

      let doc: Document = ["a", "b"]

      will create a document in the format in which a BSON array is encoded, ["0": "a", "1": "b"].

      However, since the resulting type is a Document, when nested this type is still encoded with the .document subtype, which results in confusion for the user.

      We should just remove this initializer altogether. Users can use an [BSON] instead, or create a BSON from an array as BSON conforms to ExpressibleByArrayLiteral.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: