0

Actually, I am new to AWS Lambda functions and Amazon DynamoDB, so I could not find a way to create a table with a Dynamoose schema and create CRUD operation with it.

I am familiar with mongoose and I read that Dynamoose is inspired by it.

So, can anybody tell me how to create CRUD operations in Lambda by using Dynamoose schema?

Tanuj Gupta
  • 286
  • 5
  • 20
  • 2
    The same way you would create the CRUD operations without lambda. Difference is that you create one crud operation per lambda function/API endpoint and that you need to create appropriate lambda execution role. Also, you will need to bundle the dependencies with the function. – Matus Dubrava Aug 05 '20 at 13:14
  • Thanks @MatusDubrava for the reply. Actually, I made a schema method to add object in dynamo db. But getting this error: ** "errorMessage": "2020-08-06T06:04:36.091Z 69b63932-6d6e-40c1-8cfa-b78a6ad6f033 Task timed out after 3.00 seconds"** my schema: const tableSchema = new Schema({ id: { type: String, hashKey: true, }, name: String } }); // my method. const newData = await tableSchema.create({ id: uuid.v4(), name: 'tanuj' }); – Tanuj Gupta Aug 06 '20 at 06:07
  • 1
    If you have a specific issue then I would suggest posting it as new question since the original one is a bit vague. Feel free to post the URL of the new question here and I can have a look at it. – Matus Dubrava Aug 06 '20 at 07:29

1 Answers1

0

In the same way, you would create the CRUD operations without the lambda. The difference is that you create one crud operation per lambda function/API endpoint and that you need to create an appropriate lambda execution role. Also, you will need to bundle the dependencies with the function.

Tanuj Gupta
  • 286
  • 5
  • 20