dynobase-icon
Dynobase

DynamoDB: Like (Guide w/ Code Examples)

Rafal Wilinski

Provided by Rafal Wilinski

To perform a like query using the AWS SDK for JavaScript, you need to use the contains function with the FilterExpression parameter, and pass it to a query operation.

const AWS = require('aws-sdk'); const dynamodb = new AWS.DynamoDB({region: 'us-west-2', apiVersion: '2012-08-10'}); const params = { TableName : 'YourTableName', IndexName: 'YourIndexName', KeyConditionExpression: '#name = :value', FilterExpression: 'contains(#name, :value)', ExpressionAttributeNames:{ '#name': 'name' }, ExpressionAttributeValues: { ':value': {S: 'string'} } }; dynamodb.query(params, function(err, data) { if (err) { console.log("Error", err); } else { console.log("Success", data); } });

Tired of AWS Console? Try Dynobase.

First 7 days are. No credit card needed.

Product Features

Download
/
Changelog
/
Pricing
/
Member Portal
/
Privacy
/
EULA
/
Twitter
/
Affiliates & Influencers
© 2024 Dynobase
+
Login to the AWS Console less.
Try Dynobase to accelerate your DynamoDB workflow. Start your 7-day free trial today.