You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The filter_expression method for a dynamodb query does nothing. I try the same filter expression in the AWS DynamoDB console and it works as expected. I'm not sure how to debug this issue on my end.
Regression Issue
Select this option if this issue appears to be a regression.
Expected Behavior
I expect my query filter expression to return results.
Current Behavior
The query filter expression returns an empty result with no errors.
Reproduction Steps
This is the full code of the query to reproduce the issue.
let gsi2_pk = format!("STATUSES ACCOUNT#{}", &account_id.to_string());
let mut req = self
.client
.query()
.table_name(&self.table_name)
.index_name("StatusHistoryByAccount")
.scan_index_forward(false)
.key_condition_expression("GSI2PK = :account_id")
.expression_attribute_values(":account_id", AttributeValue::S(gsi2_pk))
.limit(limit);
if let Some(next) = next {
req = req.set_exclusive_start_key(Some(next.into()));
}
if let Some(sort) = sort {
match sort.sort_by.as_str() {
"createdAt" => {
req = match sort.sort_order.as_str() {
"asc" => req.scan_index_forward(true),
"desc" => req.scan_index_forward(false),
_ => req,
}
}
_ => (),
}
}
if let Some(day) = &filters.day {
req = req.filter_expression("DayKey = :day");
req = req.expression_attribute_values(":day", AttributeValue::S(day.to_owned()));
}
let res = req.send().await?;
let statuses = match res.items {
Some(items) => items
.into_iter()
.map(|item| item.try_into())
.collect::<Result<Vec<DeviceStatus>, _>>()?,
None => Vec::default(),
};
let next = res.last_evaluated_key.map(|m| m.into());
Ok(DeviceStatusRange { statuses, next })
}
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
The filter_expression method for a dynamodb query does nothing. I try the same filter expression in the AWS DynamoDB console and it works as expected. I'm not sure how to debug this issue on my end.
Regression Issue
Expected Behavior
I expect my query filter expression to return results.
Current Behavior
The query filter expression returns an empty result with no errors.
Reproduction Steps
This is the full code of the query to reproduce the issue.
Possible Solution
No response
Additional Information/Context
No response
Version
Environment details (OS name and version, etc.)
Ubuntu 22.04.4 LTS
Logs
No response
The text was updated successfully, but these errors were encountered: