简体   繁体   English

如何通过 lambda 将 csv 数据导入到 dynamodb(nodejs)

[英]How to import csv data through lambda to dynamodb(nodejs)

I want to have a lambda function, which takes the excel file in the request body and then imports it to dynamodb based on the column in excel.我想要一个 lambda 函数,它在请求正文中获取 excel 文件,然后根据 excel 中的列将其导入到 dynamodb。

In frontend, there is an upload button to upload csv file.在前端,有一个上传按钮来上传 csv 文件。
After clicking the upload button, the excel file will be uploaded and dynamodb will take the data.点击上传按钮后,会上传excel文件,dynamodb会取数据。

Let's assume I have empty table called "User".假设我有一个名为“User”的空表。

After I upload the csv file below.在我上传下面的csv文件后。 在此处输入图片说明

The User Table should have 2 more record with the attributes in the file.用户表应该有 2 个更多的记录与文件中的属性。

I have searched for a whole day for still find a satisfied solution in nodejs.我已经搜索了一整天,仍然在 nodejs 中找到了满意的解决方案。

Can someone provide the code example to me so that I can do this?有人可以向我提供代码示例以便我可以这样做吗?

Here is a blog post of what you are looking to do, but it is python, not node.js. 这是您要执行的操作的博客文章,但它是 python,而不是 node.js。 It should be relatively easy to recode into node.js though as the code is not that difficult.重新编码到 node.js 应该相对容易,因为代码并不难。 For general code examples for DynamoDB and node.js, look here .有关 DynamoDB 和 node.js 的一般代码示例,请查看此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM