Skip to content

Conditionally adding values to DynamoDB PutRequest item #498

Answered by mblarsen
mblarsen asked this question in Q&A
Discussion options

You must be logged in to vote

Doh moment

let mut put_request = PutRequest::builder()
  .item("id".to_owned(), AttributeValue::S("foo"));

if let Some(value) = maybe_value {
  put_request = put_request.item("value".to_owned(), AttributeValue::S(value));
}

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by mblarsen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant