我有以下代码,将新项目输入SimpleDB的域。我正在使用AWS SDK For PHP Version 2。
$client->putAttributes(array(
'DomainName' => $domainName,
'ItemName' => $uniqueid,
'Attributes' => array(
array('Name' => 'USER_ID', 'Value' => $uniqueid, 'Replace' => true),
array('Name' => 'EMAIL', 'Value' => $email, 'Replace' => true),
array('Name' => 'CREATED', 'Value' => $date, 'Replace' => true),
array('Name' => 'LAST_UPDATED', 'Value' => $date, 'Replace' => true),
)
));
我如何做一个条件放?我想要的条件是,电子邮件不存在。就像:预期。Name => EMAIL预期。Exists => False,但是我不知道语法
这是API文档的链接。我不太了解他们,无法执行这个。http://docs.aws.amazon.com/aws-sdk-php-2/latest/class-Aws.SimpleDb.SimpleDbClient.html _putAttributes
谢谢!
这似乎行得通。我现在得到一个条件检查失败错误。
$client->putAttributes(array(
'DomainName' => $domainName,
'ItemName' => $uniqueid,
'Attributes' => array(
array('Name' => 'USER_ID', 'Value' => $uniqueid, 'Replace' => true),
array('Name' => 'EMAIL', 'Value' => $email, 'Replace' => true),
array('Name' => 'CREATED', 'Value' => $date, 'Replace' => true),
array('Name' => 'LAST_UPDATED', 'Value' => $date, 'Replace' => true),
),
'Expected' => array('Name' => 'EMAIL', 'Exists' => false),
));