“Beginds_With Node JS AWS DynamoDB Trie” Réponses codées

Beginds_With Node JS AWS DynamoDB Trie

let AWS = require('aws-sdk');
let util = require('util');

AWS.config.update({
    region: 'us-east-1'
});

let connection = new AWS.DynamoDB.DocumentClient();

let params = {
    TableName: 'user_details',
    KeyConditionExpression: 'user_id = :user_id and user_relation begins_with :user_relation',
    ExpressionAttributeValues: {
        ':user_id': "1234",
        ':user_relation': "followed-by"
    }
};

console.log('getQuery Params => ', params);
let dynamoDb = util.promisify(connection.query).bind(connection);
let results = await dynamoDb(params);
console.log('results => ', results);
Selfish Sardine

Beginds_With Node JS AWS DynamoDB Trie

const params = {
  TableName: 'user_details',
  KeyConditionExpression: '#user_id = :user_id and begins_with(#user_relation, :user_relation)',
  ExpressionAttributeNames:{
    "#user_id": "user_id",
    "#user_relation": 'user_relation'
  },
  ExpressionAttributeValues: {
    ":user_id": "1234",
    ":user_relation": "followed-by"
  }
}
Selfish Sardine

Réponses similaires à “Beginds_With Node JS AWS DynamoDB Trie”

Questions similaires à “Beginds_With Node JS AWS DynamoDB Trie”

Plus de réponses similaires à “Beginds_With Node JS AWS DynamoDB Trie” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code