client.query returns undefined
See original GitHub issueI’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
PS: this.db
is an instance of DocumentClient
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yes, I have 😃 The query works fine @freshollie
@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.