title: DynamoDB - How to query a nested attribute boto3
body: <p>I am following the DynamoDB python tutorial. This step shows how to query the table based on a specific key: <a href="http://docs.aws.amazon.com/amazondynamodb/latest/gettingstartedguide/GettingStarted.Python.04.html" rel="noreferrer">http://docs.aws.amazon.com/amazondynamodb/latest/gettingstartedguide/GettingStarted.Python.04.html</a>.</p>
  
  <p>Here is the code for this query:</p>
  
  <pre><code>from __future__ import print_function # Python 2/3 compatibility
  import boto3
  import json
  import decimal
  from boto3.dynamodb.conditions import Key, Attr
  
  # Helper class to convert a DynamoDB item to JSON.
  class DecimalEncoder(json.JSONEncoder):
      def default(self, o):
          if isinstance(o, decimal.Decimal):
              return str(o)
          return super(DecimalEncoder, self).default(o)
  
  dynamodb = boto3.resource('dynamodb', region_name='us-west-2', endpoint_url="http://localhost:8000")
  
  table = dynamodb.Table('Movies')
  
  print("Movies from 1992 - titles A-L, with genres and lead actor")
  
  response = table.query(
      ProjectionExpression="#yr, title, info.genres, info.actors[0]",
      ExpressionAttributeNames={ "#yr": "year" }, # Expression Attribute Names for Projection Expression only.
      KeyConditionExpression=Key('year').eq(1992) &amp; Key('title').between('A', 'L')
  )
  
  for i in response[u'Items']:
      print(json.dumps(i, cls=DecimalEncoder))
  </code></pre>
  
  <p>An example response item is</p>
  
  <pre><code>{
      "title": "Juice",
      "year": "1992",
      "info": {
          "actors": [
              "Omar Epps"
          ],
          "genres": [
              "Crime",
              "Drama",
              "Thriller"
          ]
      }
  }
  </code></pre>
  
  <p>The table has the two key attributes 'title' and 'year' as well as the nested attribute 'info'. What I am trying to do is query the database and filter the movies by genre, for example get all Drama movies. I am not sure how to do this since the genre key is nested inside info.</p>
  
  <p>I tried to get all the Drama movies from 1992 like this but it came up blank. </p>
  
  <pre><code>response = table.query(
      KeyConditionExpression=Key('year').eq(1992),
      FilterExpression=Attr('info.genres').eq('Drama')
  )
  </code></pre>
  
  <p>How do I properly filter this query with the nested info attribute?</p>