question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

client.query returns undefined

See original GitHub issue

I’m executing this function on my test:

const params = {
    TableName: TABLE_NAME,
    IndexName: TREE_INDEX,
    KeyConditionExpression: "parent = :parent",
    FilterExpression : "#l = :level",
    ExpressionAttributeNames: {
        "#l": "level"
    },
    ExpressionAttributeValues: {
        ":level": this.level,
        ":parent": parent
    }
};
const result = await this.db.query(params);

And result is undefined when it should return an array of items and when it should return an empty array

I have other queries on my code that have an index that work ok, but this one has an index and a filter expression, and for some reason, it’s not working as expected

Attached you can see that when I want to access result.Items I get an error because result is undefined

Screen Shot 2021-01-07 at 17 32 14

PS: this.db is an instance of DocumentClient

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
daianaszwimercommented, Jan 15, 2021

yes, I have 😃 The query works fine @freshollie

0reactions
fresholliecommented, Jan 15, 2021

@daianaszwimer have you tried executing this expression against a real dynamodb instance? I have a feeling your query is wrong but the return is just missing the correct error information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nodejs postgres query return undefined after transaction query
The query returns an object with property rows , you have to use rows variable in object destructuring. Example:
Read more >
useLazyQuery is returning undefined in specific scenario - Help
Hi, I am using useLazyQuery in a useEffect and I noticed a weird behavior which I am not sure if its intentional or...
Read more >
Why does Apollo client's useQuery return undefined data?
I have a GQL query that works perfectly on the playground, but just returns an undefined data when using Apollo client.
Read more >
useQuery returns undefined, But returns data on gql ...
check the apollo client query docs. something like this , and look at the error message, it should help ! import { useQuery...
Read more >
Null and undefined (Reference) - Prisma
How Prisma Client handles null and undefined, including a GraphQL use case. ... shows how an undefined parameter impacts the results returned by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found