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
>>> 
gefragt vor 2 Jahren203 Aufrufe
1 Antwort
1
Akzeptierte Antwort

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
EXPERTE
beantwortet vor 2 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen