Can I index and query against a field that holds a collection of values in Amazon's DynamoDB?

Viewed 132

Is this type of indexed query available in Amazon's DynamoDB?

(Where the field being searched against is a collection of values?)

Example object being indexed:

Restaurant: {
     name: 'Bobs Burgers'
     menu: ['hamburger', 'hotdog', 'lasagna']
}

Example pseudo-query:

SELECT * FROM restaurants WHERE menu='hamburger'
( or perhaps: 'hamburger' in menu )

Also:

  • What is this type of index called? Its been a while since I worked with this kind of thing and I have forgotten some of the correct verbiage.
  • What is a good place to get a primer on what types of queries are possible with DynamoDB?
2 Answers

No, you only can create a secondary index on scalar types which are String, Number or Binary.

It is indicated in doc as:

Every attribute in the index key schema must be a top-level attribute of type String, Number, or Binary. Other data types, including documents and sets, are not allowed.

The best point to get updated about aws dynamodb would be the official documentation i believe. They cover almost every topic in detail.

Related