Title: Earn BTC for writing a node.js function Post by: DannyHamilton on May 04, 2017, 02:16:43 PM At the moment, I'm working on a ETL project using node.js based AWS Lambda.
To save some time, I'd appreciate it if someone could put together the T (Transform) portion for me while I'm busy writing the L (Load) portion. I've defined the requirements below. Please let me know how long it will take you to write the function, and how much (in BTC) you'd require as payment for the service. tl;dr: Use the filter object to transform the data object. Find the appropriate translations and extractions in the filter object by matching with the key in the data object. Based on the filter extractions, delete columns from the "fields" AND "data" elements in the data object (preserving order of remaining values). Based on the filter translations, translate the "fields" values in the data object (preserving order). I need you to write a javascript function transform(filter,data,callback) { . . . } filter is an object defined as: Code: { Where:
data is an object defined as (for example): Code: { There will never be more than 1 dataType at a time in the data object when the transform function is called It is possible that data will not have any useful data in it. In that case it will be: Code: data = { callback is a function: function callback(err, data) { ... } Parameters: err (Error) - Set to null if the request is successful. Otherwise an error object indicating a problem. data (Object) - the transformed data object. Set to null if an error occurs. The transform() function needs to look up the data type key from the data object in the filter object to find the necessary translations and the extractions for that data type. Any occurrence of a translations key in the fields array of the data object needs to be changed in the fields array to the corresponding translations value. The order of the elements in the array must be preserved. Any occurrence of an element from the extractions array that occurs in the fields array needs to be removed from the fields array AND the values at the same offset in the data array elements must ALSO be removed. The order of the remaining elements must be preserved. Given the above examples, the resulting data object after transformation would be: Code: { Title: Re: Earn BTC for writing a node.js function Post by: DannyHamilton on May 08, 2017, 06:54:25 PM If it works: 1AfLGu4TyiWs7vuzQuQvnF1tzAo3oLhDSM :) Sent 0.01212871 mBTC: https://blockchain.info/tx/c856b871abbde160bd28d82fbdbfb652e25fd494d000ed68a1ed92967274b4b6 ($20 at current Coinbase rate of $1648.98/BTC) |