<?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: Asraful Islam</title>
    <description>The latest articles on DEV Community by Asraful Islam (@asrafulislam).</description>
    <link>https://dev.to/asrafulislam</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%2F777776%2Faae1c847-79bc-414a-ae2c-5c63a2e480c7.jpeg</url>
      <title>DEV Community: Asraful Islam</title>
      <link>https://dev.to/asrafulislam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/asrafulislam"/>
    <language>en</language>
    <item>
      <title>What is CRUD in MongoDB?</title>
      <dc:creator>Asraful Islam</dc:creator>
      <pubDate>Thu, 23 Dec 2021 16:47:34 +0000</pubDate>
      <link>https://dev.to/asrafulislam/what-is-crud-in-mongodb-2p59</link>
      <guid>https://dev.to/asrafulislam/what-is-crud-in-mongodb-2p59</guid>
      <description>&lt;p&gt;What is CRUD in MongoDB?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CRUD operation:&lt;/strong&gt; CRUD operation is the technique that allows the users to create, update, read, and delete the parts of the database.&lt;br&gt;
CRUD is standing from Create, Read, Update, Delete.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create: The Create operation is used to insert the new data into the database.&lt;/li&gt;
&lt;li&gt;Read: The read operation is used to query the data from the database.&lt;/li&gt;
&lt;li&gt;Update: The Update operation is used to edit the data from the database.&lt;/li&gt;
&lt;li&gt;Delete: The Delete operation is used to delete or remove data from the database.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Create Operation:&lt;/strong&gt; Create operation can be done in two ways.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;insertOne()&lt;/li&gt;
&lt;li&gt;insertMany()&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;insertOne():&lt;/strong&gt; In this way, one data can be inserted into the database.&lt;br&gt;
    Query:&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.insertOne({
    name: "Asraful",
    age: "26 years",
    designation: “Jr. Developer”,
    address: "Dhaka, Bangladesh",
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;insertMany():&lt;/strong&gt; In this way, multiple data can be inserted into the database.&lt;br&gt;
    Query:&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.insertMany({
    name: "Asraful",
    age: "26 years",
    designation: “Jr. Developer”,
    address: "Dhaka, Bangladesh",
}, {
    name: "Shamim",
    age: "22 years",
    designation: “Jr. Security Engineer”,
    address: "Dhaka, Bangladesh",
}, {
    name: "Naime",
    age: "27 years",
    designation: “Sr. Developer”,
    address: "Dhaka, Bangladesh",
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Read Operation:&lt;/strong&gt; We use the read operation to find single or multiple data from the database.&lt;br&gt;
There are two ways to find the data.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;find()&lt;/li&gt;
&lt;li&gt;findOne()&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;find():&lt;/strong&gt; find() operation is used to find all the data from the database. You can simply use find() to get all of them.&lt;/p&gt;

&lt;p&gt;Query:&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.find()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{ "_id" : ObjectId("5fd98ea9ce6e8850d88270b5"), "name" : "Asraful", "age" : "26 years", “designation” : “Jr. Developer”,"address" : "Dhaka, Bangladesh"}
{ "_id" : ObjectId("5fd993a2ce6e8850d88270b7"),"name" : "Shamim", "age" : "22 years", “designation” : “Security Engineer”,"address" : "Sylhet, Bangladesh"}
{ "_id" : ObjectId("5fd993f3ce6e8850d88270b8"), "name" : "Naime", "age" : "27 years", “designation” : “Sr. Developer”,"address" : "Dhaka, Bangladesh"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.collection.find({“address” : “Dhaka, Bangladesh”})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{ "_id" : ObjectId("5fd98ea9ce6e8850d88270b5"), "name" : "Asraful", "age" : "26 years", “designation” : “Jr. Developer”,"address" : "Dhaka, Bangladesh"}
{ "_id" : ObjectId("5fd993f3ce6e8850d88270b8"), "name" : "Naime", "age" : "27 years", “designation” : “Sr. Developer”,"address" : "Dhaka, Bangladesh"}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;findOne():&lt;/strong&gt; findOne() operation is used to find only one data from the database. &lt;/p&gt;

&lt;p&gt;Query:&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.findOne({query}, {projection})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{ "_id" : ObjectId("5fd993a2ce6e8850d88270b7"),"name" : "Shamim", "age" : "22 years", “designation” : “Security Engineer”,"address" : "Sylhet, Bangladesh"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Update Operations:&lt;/strong&gt; The update operation is used to update or edit any single or multiple of data from the database.&lt;br&gt;
There are 3 ways of doing this.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;updateOne()&lt;/li&gt;
&lt;li&gt;updateMany()&lt;/li&gt;
&lt;li&gt;replaceOne()&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;updateOne()&lt;/strong&gt;: It is used to update one of the data from the database. The $set keyword is used to update the specific field.&lt;/p&gt;

&lt;p&gt;Query:&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.updateOne({"_id" : ObjectId("5fd98ea9ce6e8850d88270b5"}, {$set:{“age”: "27 years"}})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;updateMany()&lt;/strong&gt;: It is used to update multiple of the data from the database. The $set keyword is used to update the specific field.&lt;/p&gt;

&lt;p&gt;Query:&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({"address" : “Dhaka, Bangladesh”}, {$set:{“designation”: "developer"}})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;replaceOne():&lt;/strong&gt; It is used to replace one document in a collection.&lt;/p&gt;

&lt;p&gt;Query:&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({"name" : “Naime”}, {“name”: “Abu Bakkar”})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{ "_id" : ObjectId("5fd993f3ce6e8850d88270b8"), "name" : "Abu Bakkar"}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Delete Operations:&lt;/strong&gt; The delete operation is used to delete or remove any single or multiple of data from the database.&lt;br&gt;
There are 3 ways of doing this.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;deleteOne()&lt;/li&gt;
&lt;li&gt;deleteMany()&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;deleteOne():&lt;/strong&gt; It is used to delete a single document from the database.&lt;/p&gt;

&lt;p&gt;Query:&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({"name" : “Naime”})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;deleteMany():&lt;/strong&gt; It is used to delete multiple documents from the database.&lt;/p&gt;

&lt;p&gt;Query:&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({"address" : “Dhaka, Bangladesh”})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>What is a Prototype in JavaScript?
</title>
      <dc:creator>Asraful Islam</dc:creator>
      <pubDate>Wed, 22 Dec 2021 16:58:45 +0000</pubDate>
      <link>https://dev.to/asrafulislam/what-is-a-prototype-in-javascript-5dg4</link>
      <guid>https://dev.to/asrafulislam/what-is-a-prototype-in-javascript-5dg4</guid>
      <description>&lt;p&gt;&lt;strong&gt;PropTypes&lt;/strong&gt;: In JavaScript, a prototype is a technique by which JavaScript objects inherit properties or features from one another. JavaScript is also known as a &lt;strong&gt;prototype-based language&lt;/strong&gt;. An object has a prototype object which has another prototype object and thus it continued until there is no prototype. This nature is known as the prototype chain.&lt;br&gt;
For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function Person(first, last, age, gender, designation,skills) {

  // property and method definitions
  this.name = {
    'first': first,
    'last' : last
  };
  this.age = age;
  this.gender = gender;
  This.designation = designation;
  //...see link in summary above for full definition
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We’ve created an object instance like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let person1 = new Person('Asraful’, 'Islam', 28, 'male', ‘Developer’,['React, Javascript']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qcxF6FTi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7dx65fm6onp7pg9wi3n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qcxF6FTi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7dx65fm6onp7pg9wi3n.png" alt="Image description" width="355" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the image, you can see that if we write &lt;em&gt;person1&lt;/em&gt;. We will see there are more properties than we declared in the Person object. Here first, last, age, gender, designation, skills are for the inheritance of the Person’s prototype object, and the other properties are for the inheritance of the Object’s prototype object.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understanding prototype chain&lt;/strong&gt;:&lt;br&gt;
If we want to check the value of &lt;em&gt;person1.age&lt;/em&gt;, it will simply return the result of the age 28. Because age is the prototype object of person1. Person1 is inheriting the properties of the object Person.&lt;/p&gt;

&lt;p&gt;But if we want to check the result of &lt;em&gt;person1.toString&lt;/em&gt; which is directly not inheriting from the Person prototype object. Then what will happen?&lt;br&gt;
Well, in that case first it will check the prototype of person1 object. If it is found then simply run it. In this case, it will not be found in the person1 prototype object. Then it will check the prototype object’s prototype object to get the property &lt;em&gt;“toString”&lt;/em&gt;. Then it will find and return the result. This nature is known as the prototype chain.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;person1.toString()
// 28
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Some Advanced Topic of CSS- CSS Selectors</title>
      <dc:creator>Asraful Islam</dc:creator>
      <pubDate>Mon, 20 Dec 2021 18:23:02 +0000</pubDate>
      <link>https://dev.to/asrafulislam/some-advanced-topic-of-css-css-selectors-549e</link>
      <guid>https://dev.to/asrafulislam/some-advanced-topic-of-css-css-selectors-549e</guid>
      <description>&lt;p&gt;There are some advanced topics in CSS. By knowing them we can write our CSS more efficiently. It will directly boost you up with your skills and level. Today we are going to explain about 3 topics.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;CSS Pseudo-Classes**&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;CSS Pseudo-Elements**&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;CSS Pseudo-Classes:&lt;/strong&gt; The pseudo-class selector is used to select the element that is in a specific state. By using this we can change the state by changing the styles. &lt;br&gt;
The most commonly used Pseudo Classes are &lt;strong&gt;active&lt;/strong&gt;, &lt;strong&gt;hover&lt;/strong&gt;, etc.&lt;/p&gt;

&lt;p&gt;Syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selector: pseudo-class {
        property: value;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the Pseudo class, a colon (&lt;strong&gt;:&lt;/strong&gt;) is used after the selector.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iaA849rT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/myws2qtqm181cz76a6kz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iaA849rT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/myws2qtqm181cz76a6kz.jpg" alt="Image description" width="297" height="350"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CSS Pseudo-Element:&lt;/strong&gt; The pseudo-elements selector has particularly used in styling specific parts of an element. By using this we can change the state of a specific part by changing the styles. &lt;br&gt;
The most commonly used Pseudo Elements are &lt;strong&gt;before&lt;/strong&gt;, &lt;strong&gt;after&lt;/strong&gt;, etc.&lt;/p&gt;

&lt;p&gt;Syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;selector:: before {
        property: value;
    }

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

&lt;/div&gt;



&lt;p&gt;In the Pseudo element, two colons (::) are used after the selector.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4mhKPOB9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2w6n6v9hgb9nt1330qao.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4mhKPOB9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2w6n6v9hgb9nt1330qao.JPG" alt="Image description" width="259" height="308"&gt;&lt;/a&gt;&lt;/p&gt;

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