javascript – DynamoDB: Dynamic function to retrive data

How to create a dynamic function using Node.js to retrieve data from AWS DynamoDB using the query method?
The function should be able to get parameters like TableName, IndexName, Key, Value, SortKey, SortValue, Filter, FilterValue, SecondFilter, SecondFildValue, ScanIndexForward, Limit. And it will be great to support the ability to get all items from the table, as Dynamo DB query retrieves only the part of items.

Thanks in advance.