hardyscc / nestjs-dynamoose

Dynamoose module for Nest
MIT License
140 stars 24 forks source link

Unable to Scan, Receive "node.forEach is not a function" error #1101

Closed SwhiteMHC closed 4 months ago

SwhiteMHC commented 5 months ago

I'm submitting a...


[ ] Regression 
[X ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

When attempting to use this.model.scan(filters).exec() to query an object with a property that is a list of maps, I use the following filter and get the following error: FYI - The table name is references and the data captured here is fake. Screenshot 2024-04-24 at 8 49 22 AM Screenshot 2024-04-24 at 8 54 12 AM

const sampleId = "fe1e58ca-b81a-4f23-a724-6a6554fa4014";
const filters = {
      recipientId: {
        eq: recipientId,
      },
      references: {
        contains: {
          identifierId: sampleId,
          identifierType: "sampleId",
        },
      },
    };

Expected behavior

The specific reference in the image is returned.

Minimal reproduction of the problem with instructions

Example object and filter provided.

What is the motivation / use case for changing the behavior?

Allows effective nested searching of maps in a list.

Environment


NestJS version: 14.0.4
NestJS Dynamoose version: ^0.5.5
Dynamoose version: ^3.2.1


For Tooling issues:
- Node version: v20.11.1
- Platform:  MacOS

Others:

hardyscc commented 5 months ago

@SwhiteMHC since this is just a wrapper of dynamoose, please raise your issue over there.