Sinatra Web服务中的语法错误[语法错误,意外的'\ n',期望=>(SyntaxError)]

时间:2019-06-20 11:58:47

标签: amazon-dynamodb sinatra

我遇到与语法错误有关的问题,但是我无法理解此错误发生的位置。我收到以下错误。

/var/app/current/app/controllers/operational_controller.rb:311: syntax error, unexpected '\n', expecting => (SyntaxError)

这是我的代码。

    skip1 = '2019-04-11'
    skip2 = '2019-04-15'
    skip3 = '2019-04-19'
    dynamodb = Aws::DynamoDB::Client.new
    table_name = 'someTable'
    query_params = {
          table_name: table_name,
          index_name: 'gsk',
          key_condition_expression: '#pk = :pk and #sk between :start and :end',
          expression_attribute_names: {
            '#pk' => 'pk',
            '#sk' => 'sk',
          },
          expression_attribute_values: {
            ':pk' => 'someValue',
            ':start' => "#{params[:code1]}###{params[:code2]}##{from_parts[0]}##{from_parts[1]}##{from_parts[2]}",
            ':end'   => "#{params[:code1]}###{params[:code2]}##{to_parts[0]}##{to_parts[1]}##{to_parts[2]}",
            ':dd1'   => "#{skip1}",
            ':dd2'   => "#{skip2}",
            ':dd3'   => "#{skip3}"
          },
          filter_expression: 'not (date in (:dd1, :dd2, :dd3))' #error here
        }
    results = dynamodb.query(query_params)

0 个答案:

没有答案