Skip to content

Scan Command Input returning 0 results from dynamoDB aws v3 #7065

Closed
@teenagarg

Description

@teenagarg

Checkboxes for prior research

Describe the bug

 const queryOptions: ScanCommandInput = {
                TableName: 'Audit',
                IndexName: 'DateTime-index',
                FilterExpression: `begins_with(#DateTime, :dateTime) AND begins_with(#Name, :name)`,
                ExpressionAttributeNames: {
                  "#Name": "Name",
                  "#DateTime": "DateTime"
                },
                ExpressionAttributeValues: {
                  ":dateTime": reportRequest.reportDate,
                  ":name": name
                },
            }

Above Scan command returns 0 results.
Node version - 18
@aws-sdk/client-dynamodb =^3.423.0
@aws-sdk/lib-dynamodb = 3.398.0

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

V3

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

18

Reproduction Steps

 const options: ScanCommandInput = {
                TableName: 'Audit',
                IndexName: 'DateTime-index',
                FilterExpression: `begins_with(#DateTime, :dateTime) AND begins_with(#Name, :name)`,
                ExpressionAttributeNames: {
                  "#Name": "Name",
                  "#DateTime": "DateTime"
                },
                ExpressionAttributeValues: {
                  ":dateTime": date,
                  ":name": name
                },
            }

const scanResults: any[] = [];
    const params = new ScanCommand(options);
    const dbResults = await this.docClient.send(params);

    if (!!dbResults.Items) {
      for await (const result of dbResults.Items) {
        scanResults.push(result);
      }
    }

    return Promise.resolve(scanResults);

Observed Behavior

ScanCommand return 0 result

Expected Behavior

It should return all results

Possible Solution

No response

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.p3This is a minor priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions