lib/ddbcli/ddb-driver.rb in ddbcli-0.3.5 vs lib/ddbcli/ddb-driver.rb in ddbcli-0.3.6
- old
+ new
@@ -602,9 +602,24 @@
convert_to_attribute_value(val)
end
end
end # key conditions / scan filter
+ # query filter
+ if action == 'Query' and parsed.having
+ req_hash['QueryFilter'] = {}
+
+ parsed.having.each do |key, operator, values|
+ h = req_hash['QueryFilter'][key] = {
+ 'ComparisonOperator' => operator.to_s
+ }
+
+ h['AttributeValueList'] = values.map do |val|
+ convert_to_attribute_value(val)
+ end
+ end
+ end # query filter
+
rd = nil
begin
rd = @client.query(action, req_hash)
rescue DynamoDB::Error => e