<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Asif Mohammed Sifat</title>
    <description>The latest articles on DEV Community by Asif Mohammed Sifat (@asifmohammedsifat).</description>
    <link>https://dev.to/asifmohammedsifat</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F779091%2F006fae62-49ce-45e0-bfaa-15ee09fc83bb.png</url>
      <title>DEV Community: Asif Mohammed Sifat</title>
      <link>https://dev.to/asifmohammedsifat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/asifmohammedsifat"/>
    <language>en</language>
    <item>
      <title>MongoDB CRUD Operations</title>
      <dc:creator>Asif Mohammed Sifat</dc:creator>
      <pubDate>Thu, 23 Dec 2021 07:33:50 +0000</pubDate>
      <link>https://dev.to/asifmohammedsifat/mongodb-crud-operations-7c</link>
      <guid>https://dev.to/asifmohammedsifat/mongodb-crud-operations-7c</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;MongoDB CRUD Operation:&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;CRUD stands for&lt;br&gt;
C- create,&lt;br&gt;
R- read, &lt;br&gt;
U-update, &lt;br&gt;
D- delete&lt;br&gt;
&lt;strong&gt;Create Operations:&lt;/strong&gt;&lt;br&gt;
MongoDB has two insert method:&lt;/p&gt;

&lt;p&gt;1.db.collection.insertOne() &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;db.collection.insertMany() 
&lt;strong&gt;InsetOne Method:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;await db.collection('inventory').insertOne({
  item: 'canvas',
  qty: 100,
  tags: ['cotton'],
  size: { h: 28, w: 35.5, uom: 'cm' }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;InsetMany Method:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;await db.collection('inventory').insertMany([
  {
    item: 'journal',
    qty: 25,
    tags: ['blank', 'red'],
    size: { h: 14, w: 21, uom: 'cm' }
  },
  {
    item: 'mousepad',
    qty: 25,
    tags: ['gel', 'blue'],
    size: { h: 19, w: 22.85, uom: 'cm' }
  }
]);


Read Operations:
Read operations retrieve documents from a collection.
db.collection.find()
Find METHOD:
const cursor = db.collection('inventory').find({
  status: { $in: ['A', 'D'] }
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Update Operations:&lt;/strong&gt;&lt;br&gt;
Update operations modify the existing documents in a collection. MongoDB provides the following methods.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;db.collection.updateOne()&lt;/li&gt;
&lt;li&gt;db.collection.updateMany()&lt;/li&gt;
&lt;li&gt;db.collection.replaceOne()
&lt;strong&gt;UpdateOne Method:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.collection.updateOne(
   &amp;lt;filter&amp;gt;,
   &amp;lt;update&amp;gt;,
   {
     upsert: &amp;lt;boolean&amp;gt;,
     writeConcern: &amp;lt;document&amp;gt;,
     collation: &amp;lt;document&amp;gt;,
     arrayFilters: [ &amp;lt;filterdocument1&amp;gt;, ... ],
     hint:  &amp;lt;document|string&amp;gt;        // Available starting in MongoDB 4.2.1
   }
)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;UpdateMany Method:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.collection.updateMany(
   &amp;lt;filter&amp;gt;,
   &amp;lt;update&amp;gt;,
   {
     upsert: &amp;lt;boolean&amp;gt;,
     writeConcern: &amp;lt;document&amp;gt;,
     collation: &amp;lt;document&amp;gt;,
     arrayFilters: [ &amp;lt;filterdocument1&amp;gt;, ... ],
     hint:  &amp;lt;document|string&amp;gt;        
   }
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Replace One Method:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.collection.replaceOne(
   &amp;lt;filter&amp;gt;,
   &amp;lt;replacement&amp;gt;,
   {
     upsert: &amp;lt;boolean&amp;gt;,
     writeConcern: &amp;lt;document&amp;gt;,
     collation: &amp;lt;document&amp;gt;,
     hint: &amp;lt;document|string&amp;gt;                   
   }
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Delete Operations:&lt;/strong&gt;&lt;br&gt;
Delete operations remove documents from a collection. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;db.collection.deleteOne()&lt;/li&gt;
&lt;li&gt;db.collection.deleteMany()&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;DeleteOne Method:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.collection.deleteOne(
   &amp;lt;filter&amp;gt;,
   {
      writeConcern: &amp;lt;document&amp;gt;,
      collation: &amp;lt;document&amp;gt;,
      hint: &amp;lt;document|string&amp;gt;        // Available starting in MongoDB 4.4
   }
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Delete Many Method&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.collection.deleteMany(
   &amp;lt;filter&amp;gt;,
   {
      writeConcern: &amp;lt;document&amp;gt;,
      collation: &amp;lt;document&amp;gt;
   }
)


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Relational Database&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What is a Relational Database?&lt;/strong&gt;&lt;br&gt;
A relational database defines database relationships in the form of tables. The tables are related to each other - based on data common to each.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Itqo9UNe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5s7o8n2jeqqyn4uftmzt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Itqo9UNe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5s7o8n2jeqqyn4uftmzt.png" alt="Image description" width="850" height="531"&gt;&lt;/a&gt;&lt;br&gt;
In Above Fig, Structure of the relational database Each box on the figure above contains one table called here the relation of the database.&lt;br&gt;
**&lt;/p&gt;

&lt;h2&gt;
  
  
  Express.js Hello World Example:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) =&amp;gt; {
  res.send('Hello World!')
})

app.listen(port, () =&amp;gt; {
  console.log(`Example app listening at http://localhost:${port}`)
})

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>React Basic </title>
      <dc:creator>Asif Mohammed Sifat</dc:creator>
      <pubDate>Wed, 22 Dec 2021 17:50:01 +0000</pubDate>
      <link>https://dev.to/asifmohammedsifat/react-basic-3742</link>
      <guid>https://dev.to/asifmohammedsifat/react-basic-3742</guid>
      <description>&lt;p&gt;What is JSX?&lt;br&gt;
JSX is a shorthand for JavaScript XML. This is a type of file used by React which utilizes the expressiveness of JavaScript along with HTML-like template syntax. This makes the HTML file really easy to understand. &lt;br&gt;
An example of JSX:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;render(){
    return(        

&amp;lt;div&amp;gt;

&amp;lt;h1&amp;gt; Hello World from Asif!!&amp;lt;/h1&amp;gt;

         &amp;lt;/div&amp;gt;

    );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What do you understand by Virtual DOM? Explain its working.&lt;/p&gt;

&lt;p&gt;A virtual DOM is a lightweight JavaScript object which originally is just the copy of the real DOM. It is a node tree that lists the elements, their attributes and content as Objects and their properties. React’s render function creates a node tree out of the React components. It then updates this tree in response to the mutations in the data model which is caused by various actions done by the user.This Virtual DOM works in three simple steps.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Whenever any underlying data changes, the entire UI is re-rendered in Virtual DOM representation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then the difference between the previous DOM representation and the new one is calculated.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once the calculations are done, the real DOM will be updated with only the things that have actually changed.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Explain the purpose of render() in React.&lt;br&gt;
It is mandatory for each React component to have a render() function. Render function is used to return the HTML which want to display in a component. If need to rendered more than one HTML element, need to grouped together inside single enclosing tag (parent tag) such as &lt;/p&gt;, ,  etc. This function returns the same result each time it is invoked.

&lt;p&gt;Example: If need to display a heading, can do this as below.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react'

class App extends React.Component {
render (){
return (
&amp;lt;h1&amp;gt;Hello World&amp;lt;/h1&amp;gt;
)
}
}
export default App
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;Points to Note:&lt;br&gt;
 Each render() function contains a return statement.&lt;br&gt;
 The return statement can have only one parent HTML tag.&lt;br&gt;
Lifecycle Methods Order In Mounting:&lt;br&gt;
Mounting is the first phases of React component lifecycle. when an instance of a component is being created and inserted into the DOM, the following methods are called- constructor(), render(), componentDidMount().&lt;/p&gt;

&lt;p&gt;Reconciliation:&lt;br&gt;
Reconciliation is When a component's props or state change, React decides whether an actual DOM update is necessary by comparing the newly returned element with the previously rendered one. When they are not equal, React will update the DOM. This process is called reconciliation.&lt;br&gt;
Higher Order Component:&lt;br&gt;
A Higher Order Component is the advanced technique in React for reusing a component logic. Higher order component takes a component and returns a new component. Simply, a higher order component transforms a component into another component. The proper example of higher order components are- redux’s connect and relay’s createContainer.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
