JSX is a syntax extension to Javascript but doesn’t it look like HTML? That’s the first question you will ask yourself when you see JSX code or any standard react template. It’s technically not HTML but to save you from the complexity you can say it is inspired by HTML.…
Category: CodeMoments
We help you to enjoy every moment of Coding. Let’s Dive In
Unit testing is an important part of the Software development life cycle and unit tests are written and executed by developers in which the smallest testable units of the code are tested to check whether the individual functionality is working as intended. The main aim of unit testing is to…
Looping is an important concept in programming. Every language has its own set of predefined looping functions that allows you to iterate over a given set of data. Javascript is no different. Filter, Map, Reduce and Foreach are widely used by javascript programmers. And often end up becoming part of…
Event Propagation is simply the ways by which order an event is captured by browser in an HTML page where elements are nested. There are basically two types of event propagation bubbling and capturing. In event bubbling the event of the innermost element is captured first while in event capturing…
Relation of column not defined is a pretty common error in postgresql and nodejs servers. Especially, beginners fail to understand and resolve this error. When you make any changes to your schema in nodejs it doesn’t reflect into postgresql db like in mongodb. You need to manually update the table…
Sometimes while exporting components and functions in react you might face an error “Object is not a function”. The clear meaning to this error is that something in your code that you are trying to use as a function is an object. When you face this error the first thing…
$or operator in mongoose is used to perform a logical OR operation on an array of expressions. It helps you in situations when you need to find documents with multiple conditions. Such as creating a search with multiple parameters. It accepts an array of expressions and returns all the documents…
In situations where you need to get documents excluding some specific values, as a beginner, you will extract all documents and use javascript to filter. But that’s not the ideal way to do this. MongoDB gifted us with a really powerful operator that can help us make a mongo query…
Population or Query Population in mongoose is a process of automatically replacing paths with other documents from other collections in a single document, multiple documents, objects, multiple objects. That’s the official definition of the population by a mongoose. But, most of us would understand this one: “Population is simply a…