Can anyone help me with filtering this sample dynamodb table to only return items where either the "old" or "new" array is not empty? In the example below, it should retrieve the items with id "2" and "3".
Table: field name = item
[
{
id: "1",
product: {"new": [], "old": []},
},
{
id: "2",
product: {"new": [{name: "a"}], "old": [name: "a"]},
},
{
id: "3",
product: {"new": [], "old": [name: "a"]},
},
]
I would like the filter expression to look something like this:
FilterExpression: 'isTest = :boolean',
ExpressionAttributeValues: { ':boolean': isTest },