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
>>> 
preguntada hace 2 años203 visualizaciones
1 Respuesta
1
Respuesta aceptada

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
EXPERTO
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas