Define association in Sequelize - Nest jsSay we have two model portfolio and stock. Each item from the portfolio belongs to one stock. We need to define this relationship in sequelize. The general rule is to have a column stockId in the portfolio that will map with the id from stock table. ...Aug 18, 2023·2 min read
API with Nest js and sequelizeWe'll start from the vey basic. Install nestjs cli globally and use it to create the nest js project. $ npmi -g @nestjs/cli $ nest new project-name Run the project npm run start Go to main.ts file to check what port the app is running async functio...Aug 8, 2023·6 min read
filter() in javascriptLet's start with a question. const filteredMetaData = metaData.filter((md) => md.Code== 2010)); A. If(filteredMetaData.length){ } B. If(filteredMetaData){ } Which option should be used when you want to enter inside the if condition when the filte...Aug 6, 2023·2 min read
Cannot Read property of Undefined/null in JavaScriptThe title is a familiar javascript error we all have encountered. Not just in the js, we get a similar error message when we try to call function on an undefined variable. Example In the example x is null and y is undefined.When we make a call to ...Aug 4, 2023·2 min read