searching in list of values in dynamodb schema using dynamoose in node

285 views Asked by At

I have a dynamo db schema lets say goes like this

const team = new dynamoose.Schema(
  {
   bitbucketDetails: [
      {
        id: {
          type: String,
          required: true,
        },
        repository: {
          type: String,
        },
      
      },
    ],
})

I wanted to search for an item having lets say particular repository "abc". how can i search that?

so far i tried something like team.scan({ bitbucketDetails: { contains:"abc" }}).all().exec() but keep saying ValidationException: One or more parameter values were invalid: ComparisonOperator CONTAINS is not valid for M AttributeValue type.

Please help!!

1

There are 1 answers

2
karjan On

You are looking for the value in bitbucketDetails, but you want to look in bitbucketDetails.repository.