[英]Filter and scan a table DynamoDB in PHP
I have a table Client
which contains information like this : 我有一个表Client
,其中包含以下信息:
{
"address": "XXX",
"contact_email": "XXX",
"id": 1,
"password": "XXX",
}
The primary partition key is the id
(Number) and I want to retrieve a client information by a contact_email
using PHP. 主分区键是id
(数字),我想使用PHP通过contact_email
检索客户端信息。
When you query the dynamodb, partition key is must. 当查询dynamodb时,必须使用分区键。 When you scan the dynamodb, partition key is optional. 当您扫描dynamodb时,分区键是可选的。 But Scan is slower than Query. 但是扫描比查询慢。
Try with this 试试这个
var params = {
"TableName": tableName,
"FilterExpression": "contact_email = :val1",
"ExpressionAttributeValues": {
":val1": contact_email
},
"ReturnConsumedCapacity": "TOTAL"
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.