Код: Выделить всё
private DynamoDBQueryExpression createQueryBySchoolName(String schoolName) {
String matchSchoolName = "schoolName = :schoolName";
Map schoolNames = new HashMap();
schoolNames.put(":schoolName", new AttributeValue().withS(schoolName));
return new DynamoDBQueryExpression()
.withIndexName("schoolName-index")
.withKeyConditionExpression(matchSchoolName)
.withExpressionAttributeValues(schoolNames)
.withConsistentRead(false);
}
Код: Выделить всё
id schoolName details
Код: Выделить всё
{
"zone": "North",
"type": "Convent",
"address": {
"id": "138",
"street1": "123 Street",
"street2": "456 Road"
}
}
Код: Выделить всё
private DynamoDBQueryExpression createQueryBySchoolName(String schoolName) {
String matchSchoolName = "schoolName = :schoolName";
Map schoolNames = new HashMap();
schoolNames.put(":schoolName", new AttributeValue().withS(schoolName));
schoolNames.put(":streetName", new AttributeValue().withS("123 Street"));
return new DynamoDBQueryExpression()
.withIndexName("schoolName-index")
.withKeyConditionExpression(matchSchoolName)
.withFilterExpression("details.address.street1 = :streetName")
.withExpressionAttributeValues(schoolNames)
.withConsistentRead(false);
}
Подробнее здесь: https://stackoverflow.com/questions/617 ... on-in-java
Мобильная версия