Advertisement
Guest User

Untitled

a guest
Feb 14th, 2020
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. console.log('starting function');
  2.  
  3. const AWS = require('aws-sdk');
  4. const docClient = new AWS.DynamoDB.DocumentClient({region:'us-east-1'});
  5.  
  6. exports.handler = function(e, ctx, callback){
  7.  
  8. let scanningParameters = {
  9. TableName: 'tabela_projekt',
  10. Limit:3
  11. };
  12.  
  13. docClient.scan(scanningParameters, function(err, data){
  14. if(err){
  15. callback(err, null);
  16. }
  17. else{
  18. callback(null, data);
  19. }
  20. });
  21.  
  22. /*var params = {
  23. TableName: 'tabela_projekt',
  24. Key: {
  25. "mat_id": rekord1
  26. }
  27. }
  28. docClient.get(params, function(err, data){
  29. if(err){
  30. callback(err, null);
  31. }else{
  32. callback(null,data);
  33. }
  34. })*/
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement