title: How to use scan filters with boto3 for dynamodb
body: <p>I'm trying to test sample filters with dynamodb using boto3. My simple example -written almost identical to the <a href="http://boto3.readthedocs.io/en/latest/guide/dynamodb.html#querying-and-scanning" rel="nofollow noreferrer">documented</a> one- fails. I'm using a Table 'User' that correctly works with <code>.scan</code>:</p>
  
  <pre><code>In [24]: list(User.scan())
  Out[24]: [users_info-dev&lt;giovanni&gt;, users_info-dev&lt;nicola&gt;, users_info-dev&lt;ping&gt;]
  </code></pre>
  
  <p>When trying to filter on a key:</p>
  
  <pre><code>User.scan(FilterExpression=Attr('user_id').eq('giovanni'))
  ---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  ...
  
  ValueError: Attribute FilterExpression specified for filter does not exist.
  
  from boto3.dynamodb.conditions import Key, Attr
  </code></pre>
  
  <p>What's the error and which is the correct way to execute this scan?</p>
  
  <p>Note: I have not really got the difference between scan and query. It seems 'query' should be used for filtering on primary key. Having a background on SQL db that sounds wierd to me...</p>