Amazon web services DynamoDB DocumentClient条件表达式-If语句

Amazon web services DynamoDB DocumentClient条件表达式-If语句,amazon-web-services,amazon-dynamodb,Amazon Web Services,Amazon Dynamodb,想知道是否有任何方法可以在Put上编写ConditionExpresson if语句,这是我正在寻找的伪代码示例: IF email already exists AND verified equals false THEN allow PUT IF email already exists AND verified equals true THEN don't allow PUT IF email does not exist THEN allow PUT 干杯以一种更优

想知道是否有任何方法可以在Put上编写ConditionExpresson if语句,这是我正在寻找的伪代码示例:

IF email already exists AND verified equals false 
   THEN allow PUT
IF email already exists AND verified equals true
   THEN don't allow PUT
IF email does not exist
   THEN allow PUT

干杯

以一种更优雅的方式结束了:

query.Item = {
    email: email,
    verified: false,
    verifyToken: token
};

query.ExpressionAttributeNames = {
    '#verified' : 'verified'
};

query.ExpressionAttributeValues = {
    ':false' : false,
};

query.ConditionExpression = '#verified = :false OR attribute_not_exists(verified)';

最后一次
验证的
是普通的,有什么原因吗?