Fetching a Record

  • To fetch a record, you need its primary key
  • You should get back an item of the type you defined in Java
public UserModel fetchUser(String userId) {
    Key key = Key.builder()
        .partitionValue(userId)
        .build();
        
    UserModel model = userTable.getItem(key);
}

17 / 22