title: How to perform DynamoDB scan using filterExpression in swift
body: <p>I have a table that stores information about groups (GroupID, Members, Creator, LastAccessed, GroupName, etc..) as separate rows. Each group has a unique identifier (GroupID) as their hash (primary key). They also have an attribute called GroupName. I have a search box where the user inputs a partial group name. I want to perform a scan on the table and return all of the groups that begin with the users input. Here is what I have so far..</p>
  
  <pre><code>func searchForGroupsWithName(groupName: String) {
  
      self.queryInProgress = true
  
      let cond = AWSDynamoDBCondition()
      let v1    = AWSDynamoDBAttributeValue();
      v1.S = groupName
  
      cond.comparisonOperator = AWSDynamoDBComparisonOperator.BeginsWith
      cond.attributeValueList = [ v1 ]
  
      let exp = AWSDynamoDBScanExpression()
  
      //I only want to return the GroupName and GroupID.
      //I think this should be ["GroupID", "GroupName"], but it requires a string
      exp.projectionExpression = ??????????
  
      //I am not sure how to incorporate cond with this.
      exp.filterExpression = ??????????
  
      dynamoDBObjectMapper.scan(GroupTableRow.self, expression: exp).continueWithBlock({ (task:AWSTask!) -&gt; AnyObject! in
  
          if task.result != nil {
              let paginatedOutput = task.result as! AWSDynamoDBPaginatedOutput
  
              for item in paginatedOutput.items as! [GroupTableRow] {
                  self.searchBarResults.append(item)
              }
  
              if ((task.error) != nil) {
                  print("Error: \(task.error)")
              }
              self.queryInProgress = false
              return nil
          }
          self.queryInProgress = false
          return nil
      })
  }
  </code></pre>