Using an Index

  • Queries let you look up a number of items at once
  • Queries may return a huge number of items. This makes for a weird API
  • You get back a bunch of Pages and you read results from the Pages
QueryConditional query = QueryConditional
    .keyEqualTo(Key.builder().partitionValue(name).build());

var iterable = userTable.index("name-index")
    .query(query);
List<UserModel> users = new ArrayList<>();
for(Page<UserModel> user: iterable) {
    users.addAll(user.items());
}

20 / 22