title: DynamoDB putItem ConditionExpression "boolean" true
body: <p>am trying to do a ConditionExpression in a DynamoDB put to check whether a stored boolean is true (in this example, whether the user is already verified don't run the put), i'm using the javascript DocumentClient SDK (thanks to @shimon-tolts), the code looks like:</p>
  
  <pre><code>var query = {
      TableName: tableName,
      Item: {
          email: email,
          verified: false,
          verifyToken: token
      },
      ConditionExpression: 'attribute_exists(email) AND verified = :bool',
      ExpressionAttributeValues: {
          ":bool":"false"
      }
  };
  
  dynamodb.put(query, function(err, data){
      if (err) return fn(err)
      fn(null, data);
  });
  </code></pre>
  
  <p>Which doesn't work, it fails the condition check no matter what the call.</p>
  
  <p>Pretty much what I need (in pseudocode):</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Any ideas?</p>