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

Consider providing subscript access to DBs and collections

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Some other drivers provide access to DBs from a client, and to collections from a DB by subscripting. We should consider providing this as a shortcut to users. For example:

      let client = try MongoClient()
      let db = client["myDB"]
      let coll = db["myColl"]

      An argument against this is that we cannot throw from subscript getters, so we would have to figure out some way to deal with errors. 

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated: