AWS simple Crud operation - node.js

I am new to AWS. for initial understanding i need..
full flow from Angularjs(which i know) -> api gateway(i know) -> lambda(node.js) -> dynamodb.
i am looking for simple CRUD operation samples. i know how to write code in Angular, APIGateway but struggling out with Lambda(Node.js) for writing code that can perform CRUD operation on dynamodb Table.
can any one please provide link or sample project which contain sample code in node.js. (i have googled it a lot but couldnt find out straight away samples) i am also following aws document site. but i feel its slightly complex or i am stupid :) )
Thanks in advance.

I have an example project which shows how to use vogels (a DynamoDB data mapper for nodejs) with lambda. Currently, the project just has a single function which writes data to a DynamoDB table, but would be easy to add more CRUD functions.

Related

JSON result from mysql tabl

I need to write an API in nodejs to showing JSON result from mysql tables. I want little hint. I am .net experienced developer but new in Nodejs
any sample code to get similar result will be enough for me.
Best Regards,
Screenshots of Requirement

How to execute HTTP DELETE request in AWS Lambda Nodejs function

I am trying to create an AWS Lambda transform function for a Firehose stream that sends records directly to an Elasticsearch cluster.
Currently, there is no way to specify an ES document id in a Firehose stream record, so all records, even duplicates, are inserted. However, Firehose does support transformation functions hosted in Lambda, which gave me an idea:
My solution is to create a Lambda transform function that executes a DELETE request to Elasticsearch for every record during transformation, then returning all records unmodified, thereby achieving "delete-insert" behaviour (I am ok with the record disappearing for a short period).
However, I know very little about Nodejs and even though this is such a simple thing, I can't figure out how to do it.
Is there a Node package available to Lambda that I can use to do this? (Preferably an AWS Elasticsearch API, but a simple HTTP package would do).
Do I have to package up some other module to get this done?
Can something like Apex help me out here? My preferred language is Go, but so far I have been unable to get apex functions to execute or log anything to Cloudwatch...
Thanks in advance.
It seems a simple task to do, so I guess no framework is needed.
A few lines of code in Node.js would get the things done.
There are two packages that can help you:
elasticsearch-js
http-aws-es (If your ES domain is protected and you need to sign the requests)
The API doc: https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/api-reference.html

Does any one know about simple CRUD operations example in ReactJS and Nodejs?

I am beginner in Reactjs and Nodejs.
I just want to build a simple application which performs CRUD operations.
ReactJS for displaying data and act as a front-end.
Nodejs have some API which returns static data.
If anyone know about some blog or have some example with you than please share. This will help me to start with this.
I also searched for many articles online but they all are consist database connection, ExpressJs which i don not need at this time.
You can see here:-
In this repository you can see crud operation in reactjs and nodejs and mysql database used here.
https://github.com/abhi4pr/express-react-app

How to fetch data from an api and store it in a database with nodejs and mongodb

I want to clone a public api into a mongodb database with nodejs so I can run my own queries and extend the data like I want. My problem is that I want to fetch the newest updates as well. The good thing is that I know when the data will change at the api app approximately.
I thought about something like cronjobs or a setInterval.
In the internet I could find many solutions how to transform a database into a rest api but no vice versa.
Please give me suggestions how to solve this problem.

BreezeJS with a NodeJS API (not directly to MongoDB)

I'm researching BreezeJS for a big upcoming project.
Our goal is a offline first web app.
But here is what I can't fully understand (and would take to much time to test) - Does BreezeJS allow for the backend to be a REST API (built with NodeJS and Express)?
We need this because we don't want to simply sync to a remote DB (in our case Mongo), but use a remote REST API so that we can embed some business logic. Things like workflow triggering on a POST to a particular entity.
Is this possible with BreezeJS? If not what would be a good option?
Thanks in advance
It is certainly possible, simply take the breeze-mongo server implementation and strip out the mongo specific code. This should be fairly straight forward, express and mongo are pretty well separated in the code.
That said, you would lose or have to rewrite much of the server side code that converts an OData query string into a mongo query, but if you are going pure 'REST' you probably don't want that anyway.
You would have to do something similar on the save/POST side, but this is presumably something you are already familiar with.

Resources