Skip to content

Instantly share code, notes, and snippets.

@nkbt
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkbt/dccfbc6ee187d9beeeb9 to your computer and use it in GitHub Desktop.
Save nkbt/dccfbc6ee187d9beeeb9 to your computer and use it in GitHub Desktop.

Working with AWS makes me feel like coding in AST.

var params = {
  TableName: 'Table',
  AttributesToGet: [
    'BucketId',
    'BucketKey'
  ],
  KeyConditions: {
    Id: {
      AttributeValueList: [
        {S: 'feed:1.0'}
      ],
      ComparisonOperator: 'EQ'
    }
  },
  Limit: 1
};

db.query(params, function (err, result) {

Instead of

SELECT BucketId, BucketKey
  FROM Table 
  WHERE Id = "feed:1.0" 
  LIMIT 1 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment