You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a feature proposal to add a new function Table.prototype.createParams which will return the validated, processed parameters required to create the item using the DynamoDB API. It would behave like this:
constitem=newMyItem({....});item.createParams((err,params)=>{// params have been validated by schema and processed by `create` hook // do something with params});
Why
AWS Data Pipeline provides a helpful solution for the hard-ish problem of bulk loading data into DynamoDB. It reads JSON files from S3 and throttles the rate at which data is written to DynamoDB.
It would be nice to use Dynogels models schema validation and data processing to generate the required JSON.
Proposal
I think this should be straightforward. Look here in internals.createItem in table.js. I think we just want to return params without calling sendRequest.
So, here is what I'm proposing, specifically. I'd be willing to take a crack at it if it's acceptable.
Separate the code in internals.createItem before sendRequest into a new function internals.makeCreateItemParams, and call this inside internals.createItem
Add a new function Table.prototype.createParams() which returns the value from internals.makeCreateItemParams
(Maybe do the same for updateItem and deleteItem too).
The text was updated successfully, but these errors were encountered:
aneilbaboo
changed the title
Output to JSON suitable for S3 import
A method which returns the raw DynamoDB params for creating an item
Dec 11, 2018
This is a feature proposal to add a new function
Table.prototype.createParams
which will return the validated, processed parameters required to create the item using the DynamoDB API. It would behave like this:Why
AWS Data Pipeline provides a helpful solution for the hard-ish problem of bulk loading data into DynamoDB. It reads JSON files from S3 and throttles the rate at which data is written to DynamoDB.
References:
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBPipeline.html
http://eng.hakopako.net/entry/2016/08/22/100000
It would be nice to use Dynogels models schema validation and data processing to generate the required JSON.
Proposal
I think this should be straightforward. Look here in
internals.createItem
intable.js
. I think we just want to return params without callingsendRequest
.So, here is what I'm proposing, specifically. I'd be willing to take a crack at it if it's acceptable.
internals.createItem
before sendRequest into a new functioninternals.makeCreateItemParams
, and call this insideinternals.createItem
Table.prototype.createParams()
which returns the value frominternals.makeCreateItemParams
(Maybe do the same for
updateItem
anddeleteItem
too).The text was updated successfully, but these errors were encountered: