9

I am having an issues with understanding does dynamoDb supports filtering by object properties nested in array. Example:

Consider that we have following table called "Street" where one item (row) in that table have following structure:

{
   name: "Street name",
   population: 20,
   houses: 5,
   people: [
      {
          first_name: "FName1",
          last_name: "LName1",
          ... other person's properties
      },
      {
          first_name: "FName2",
          last_name: "LName2",
          ... other person's properties
      },
      {
          first_name: "FName3",
          last_name: "LName3",
          ... other person's properties
      }

      ... etc
   ]
}

We can consider in this scenario that "name" is dynamodb prefix = which means that we can query based on the street name.

I am interested does dynamodb supports following logic: "Query based on street with specific name and filter it for the person with following specific name."

The result would be something like (whole point is to return only one person/object from array which match the filter)

{
   name: "Street nameX",
   population: 20,
   houses: 5,
   people: [
      {
          first_name: "FNameX",
          last_name: "LNameX",
          ... other person's properties
      }
   ]
}

Basically question is, can dynamoDb filter results after query based on the object properties nested in array.

Please make a note that I understand that I can achieve this with different table schema - but this example is used for simplicity and it is as it is - focusing question on 'does dynamoDB have support for something like this or not?'.

1 Answer 1

4

Looks like this is still not supported (at least back then at 2014).

Filtering / Querying by the Contents of a List in DynamoDB

Sign up to request clarification or add additional context in comments.

1 Comment

Any idea if its possible now? contains() works for basic arrays, but seemingly not for objects in an array

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.