Skip to content

Condition Expression like "<> 10.10.10" produces NaN in ExpressionAttributeValues #52

@ankit-aabad

Description

@ankit-aabad

for following expression

const params = dynoexpr({
  KeyCondition: { id: '567' },
  Condition: { ip: '<> 10.10.10.10' },
  Filter: { color: 'blue' },
  Projection: ['weight', 'size'],
});
console.log(params);

dynoexpr produces

{
  KeyConditionExpression: '(#nca40fdf5 = :v8dcca6b2)',
  ExpressionAttributeNames: {
    '#nca40fdf5': 'id',
    '#n22c40d10': 'ip',
    '#n2d334799': 'color',
    '#neb86488e': 'weight',
    '#n0367c420': 'size'
  },
  ExpressionAttributeValues: { ':v8dcca6b2': '567', ':veb17932c': NaN, ':v792aabee': 'blue' },
  ConditionExpression: '(#n22c40d10 <> :veb17932c)',
  FilterExpression: '(#n2d334799 = :v792aabee)',
  ProjectionExpression: '#neb86488e,#n0367c420'
}

in ExpressionAttributeValues produces ':veb17932c': NaN
whenever we have more than one dot like 10.10.10 it considers as number and gives NaN

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions