Dynamo scan not finding records of time in unix.

0

Below are the params:

let params = {
    TableName: SESSIONTABLE,
    ProjectionExpression: 
        "practitioner_full_name, appointment, utc_offset, start_time, start_time_unix, attendees, practitioner_email, id, practitioner_id, no_video_link, title, practitioner_title, service_text",
    FilterExpression:
        "(start_time_unix between :currentTime and :unixTimeAfteramin)",
    ExpressionAttributeValues: {
        ":currentTime": 1660297747000,
        ":unixTimeAfteramin" : 1660297807000,
    },
    };

This is the value of start_time_unix column - 1660297800000

The value of start_time_unix lies well within currentTime and unixTimeAfteramin column values.

Not sure what's wrong with dynamodb here. I tried the three values in python shell as well, it works good there.

Python 3.8.10 (default, Jun 22 2022, 20:18:18) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1660297747000 < 1660297800000 < 1660297807000
True
>>> 
已提問 2 年前檢視次數 203 次
1 個回答
1
已接受的答案

How much data is in your table? When you execute a Scan request, it will return only the first 1MB of data (described here) and if none of those items match the FilterExpression then you will be returned an empty response.

In order to scan the entire table, you will need to implement pagination so that you can request the next 1MB worth of data. Described here. You can also see examples of this in out GitHub Repo in various languages.

The AWS CLI paginates by default, you can try run your request there which will allow you to quickly understand if that is the issue.

profile pictureAWS
專家
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南