I have a table storedgames
, which contains 2092 items.
And it also has an index on that table, which also lists 2092 items.
when I fetch data, I use the index, to obtain the items for one specific user.
const params = {
TableName: "storedgames",
IndexName: "user-index",
KeyConditionExpression: "#usr = :usr",
ExpressionAttributeNames: { "#usr": "user" },
ExpressionAttributeValues: { ":usr": user }
};
const data = await new Promise((resolve, reject) => {
docClient.query(params, (err, data) => {
if (err) { reject(err); } else { resolve(data); }
});
}).catch((err) => {
console.error(err);
return false;
});
However, the above code does not return all items. It only finds 42. And for today's items there is only 1 hit. When I check directly on the AWS webpage, I actually find more items for today.
And even when I do this using the index, it finds more records.
When I leave out the filtering of the day, I actually find over 130 items, while my javascript code only returns 42 items when I leave out the day filter.
So my question is, why does the data of my index seem to be incomplete when I call it programmatically ?