<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Affan Ahmad on Medium]]></title>
        <description><![CDATA[Stories by Affan Ahmad on Medium]]></description>
        <link>https://medium.com/@affanahmad2797?source=rss-641fee15043d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3d5lBSy1qwa8PIDUcqSo1Q.jpeg</url>
            <title>Stories by Affan Ahmad on Medium</title>
            <link>https://medium.com/@affanahmad2797?source=rss-641fee15043d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 16:44:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@affanahmad2797/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Algorithm for making combinations of mongo queries using JavaScript Map Method]]></title>
            <link>https://medium.com/@affanahmad2797/algorithm-for-making-combinations-of-mongo-queries-using-javascript-map-method-d6470bc4a1f7?source=rss-641fee15043d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6470bc4a1f7</guid>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[map-method]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[filtering]]></category>
            <category><![CDATA[search-queries]]></category>
            <dc:creator><![CDATA[Affan Ahmad]]></dc:creator>
            <pubDate>Tue, 30 Aug 2022 16:40:56 GMT</pubDate>
            <atom:updated>2022-08-31T08:21:43.615Z</atom:updated>
            <content:encoded><![CDATA[<p>Suppose you have a huge collection of data and you want to find a particular product of a selected brand such as <strong>Nykaa Cosmetics </strong>and a particular category such as <strong>Lip Balm</strong> from it. Your code would look like</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*jUYhR8JLdYHR8jjjtdBjkg.png" /><figcaption>image 1 : Query of finding a combination of a brand and a product type</figcaption></figure><p>But, what if you have to make a query for various combinations of different set of items.</p><p>Let’s say a user has selected 2 product categories, the first one is <strong>Lip Balm</strong> and the other one is <strong>Lipstick </strong>and the brands which have been selected are <strong>Nykaa Cosmetics</strong>, <strong>Earth Rhythm </strong>and <strong>Kay Beauty</strong>.</p><p>check this <a href="https://youtu.be/aN2SXWwLbBw">video </a>for more clarity.</p><p>So, the various possible combinations are as follows</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*_3oLgg2bC_FfPwCPbn_HFQ.png" /><figcaption>table 1: Table of various possible combinations</figcaption></figure><p>For the above combinations, the query should look like <em>image 2</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*QBvUjSk-Qi0bBdEiTZA8YQ.png" /><figcaption>image 2: Various possible combinations</figcaption></figure><h3>Here is the detailed step by step procedure to make this query dynamic</h3><h4>Step 1) Create a file with a name “map.js” :-</h4><p>You can use any name but, we have to use this file again so it would be a better option to have a file with the same name.</p><p>Now, write the following code in the map.js</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*A4VBhVeOjcv1mwocod6_gA.png" /><figcaption>image 3: Creating a map object using Map Method</figcaption></figure><p>Here we have created a map object Using Map method with <em>product type</em> as <em>key </em>and <em>brands </em>as <em>values</em>. The output of the above code is</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*7Q0dj7TjVUjlHJTA7sminw.png" /><figcaption>image 4: Output of map</figcaption></figure><p>Here we have created key-value pairs of the various possible combinations, compare it with the table above, for every product, we have created a set of it with brands. Now we have to make an array of these combinations.</p><h4>step 2) Making an array of all possible combinations :-</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*jDUSc0UlgyRdbYP_-033KA.png" /><figcaption>image 5: Making array of combinations</figcaption></figure><p>Let’s see the output coming from this code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*daofbMgHfsqnRzJomotR-g.png" /><figcaption>image 6: Output after making array of all the combinations</figcaption></figure><p>Now, we got the array of combinations but, we can not use the above array in our query as we have to use <strong>or </strong>&amp; <strong>and </strong>operator as shown in <strong><em>image 2</em></strong>.</p><h4>step 3) Making an array with elements having $and as a key :-</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*4WS8hc1JUIka2K_gqyN1Qw.png" /><figcaption>image 7: Making array using $and operator as a key for elements</figcaption></figure><p>The output of the above created array looks like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*mfHHEtz2gKG4HdA2uIZUkA.png" /><figcaption>image 8: Output of queryArr</figcaption></figure><p>Now, let’s check what the <strong>Object </strong>contains</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*L8Iz1hq0s-r5wmmZ8pCJFA.png" /><figcaption>image 9: Output of the element at 0th index of queryArr</figcaption></figure><p>To make this code reusable, let’s wrap this into a single function and export it.</p><h4>step 4) Wrapping the whole code inside a function and exporting :-</h4><p>Now, we have to comment out the arrays that we had used while making our queries at step 1, see the image below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/1*ZZgCbMnYAwrjmzWDxOY9RQ.png" /><figcaption>image 10: Wrapping of the code inside a function and exporting</figcaption></figure><p>now we need to import the above function in the file where we have written our query.</p><h4>step 5) Import the above function in the file where we have written the mongo query :-</h4><p>Import <strong><em>createQueries </em></strong>function from map.js</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*fTp7Zt5lf4_HNqDZnQytdQ.png" /><figcaption>image 11: Import algorithm from map.js and use it inside mongo query code</figcaption></figure><p>And that’s it, that’s how I created an algorithm using <strong>Map method </strong>for Mongodb Queries<strong>.</strong></p><p>Thanks for your time.</p><p>note:</p><ol><li>Your document of data should contain <em>product_type</em> and <em>brand </em>as keys</li><li>You should have a little knowledge of how mongo queries work in general and its operators in particular.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6470bc4a1f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tata 1mg Project]]></title>
            <link>https://medium.com/@affanahmad2797/tata-1mg-project-3079041dde2c?source=rss-641fee15043d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3079041dde2c</guid>
            <dc:creator><![CDATA[Affan Ahmad]]></dc:creator>
            <pubDate>Sun, 27 Feb 2022 14:04:30 GMT</pubDate>
            <atom:updated>2022-02-27T15:12:19.250Z</atom:updated>
            <content:encoded><![CDATA[<p>At Masai School we are required to make projects in the final week of every unit, currently, I am in unit II and I got to work on the cloning of the Tata 1mg website along with my team.</p><p>Tata 1mg is India’s one of the leading online pharmacy Websites.</p><p>We were a team of 6 members including <strong>Devesh Goyal</strong>, <strong>Shubham Verma</strong>, <strong>Paras Aghi</strong>,<strong> Chiranjit Behera</strong>, <strong>Sampanna Chatterjee</strong>, and me(<strong>Affan Ahmad</strong>).</p><p><strong><em>Technologies and Tools we Used:</em></strong></p><p><strong>·</strong> HTML</p><p>· CSS</p><p>· JavaScript</p><p>· GitHub</p><p>· Readme.so</p><p><strong><em>Challenges:</em></strong></p><p>The Journey was full of challenges the work was big so as the challenges.</p><p>The very first challenge was the assignment of work to each and every team member it was this tough because we didn’t know any of our team members in the starting it was just like a blind date. So to overcome this challenge we decided to divide the whole work in the form of pages and assigned every one to complete his/her page. As a result of it every individual was able to work on every tool.</p><p>Now the second challenge was merging of project , whenever we tried to merge the branches, hundreds of conflicts were there to resolve as we were using the GitHub for the very first time, we didn’t even know how to use it. But, we did a great job here that we started working on the GitHub on the very first day so at the end everything was handy.</p><p><strong><em>Roles and Responsibilities: </em></strong>Our work can be breakdown into 10 major works i.e.</p><ol><li><strong>Header</strong> by :<strong>Sampanna Chatterjee</strong> and <strong>Devesh Goyal</strong>,</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qnr4gf9yNTYOdGyfzGMOMQ.png" /><figcaption><strong>Header</strong></figcaption></figure><p><strong>2. Home Pag</strong>e by: <strong>Affan Ahmad,</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kKnayruyIpjAIhaLSlRDaw.png" /><figcaption><strong>Home Page</strong></figcaption></figure><p><strong>3. Products Page</strong> by:<strong> Affan Ahmad </strong>and<strong> Shubham Verma</strong>;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7EsDjJ1MmVU-jqv9HvSZ_g.png" /><figcaption><strong>Product”s Page</strong></figcaption></figure><p><strong>4. Lab Page</strong> by:<strong> Affan Ahmad </strong>and <strong>Paras Aghi,</strong></p><p><strong>5. Ayurveda Page</strong> by: <strong>Sampanna Chatterjee</strong>,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O45lZfDS03h2PNap0YNYew.png" /></figure><p><strong>6. Ask to Doctor Page</strong> by: <strong>Devesh Goyal,</strong></p><p><strong>7. Login &amp; Signup Page </strong>by:<strong> Devesh Goyal,</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VAIFiE4gbgZRQyLa_vd7bw.png" /></figure><p><strong>8. Cart</strong> by: <strong>Chiranjit Behera,</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yjNnUMIderbhbKEHw7pXiA.png" /></figure><p><strong>9. Footer</strong> by: <strong>Shubham Verma,</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-TvKSHT6svrh__zRsMCew.png" /><figcaption><strong>Footer</strong></figcaption></figure><p><strong>10. Data Collection </strong>by:<strong> Affan Ahmad,</strong></p><p><strong><em>Resources And Documents Used for the construction of our Website:</em></strong></p><ol><li><a href="https://developer.mozilla.org/en-US/">https://developer.mozilla.org/en-US/</a></li><li><a href="https://www.w3schools.com/">https://www.w3schools.com/</a></li><li><a href="https://www.youtube.com/c/JamesQQuick">https://www.youtube.com/c/JamesQQuick</a></li><li><a href="https://www.1mg.com/">https://www.1mg.com/</a></li></ol><p><strong><em>Ending Note:</em></strong></p><p>We tried to make our website as responsive as possible and user friendly, I am very happy that we were able to finish our project within the stipulated time. It was a great time to work with such a enthusiastic and supportive team members.</p><p>You can watch a demo of our website by clicking <a href="https://drive.google.com/file/d/1Va2ysLJWNovQOX7DDi-49CEr-HTd4jft/view?usp=sharing">here</a>.</p><p>You can also check our work on GitHub by clicking <a href="https://github.com/AFFAN-AHMAD/project-1mg">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3079041dde2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My journey to Masai School]]></title>
            <link>https://medium.com/@affanahmad2797/my-journey-to-masai-school-736e6b6c9172?source=rss-641fee15043d------2</link>
            <guid isPermaLink="false">https://medium.com/p/736e6b6c9172</guid>
            <dc:creator><![CDATA[Affan Ahmad]]></dc:creator>
            <pubDate>Thu, 06 Jan 2022 12:12:24 GMT</pubDate>
            <atom:updated>2022-01-07T07:23:15.157Z</atom:updated>
            <content:encoded><![CDATA[<p>As they say, “if there is a will there is a way”.</p><p>I have finally and fortunately found the <strong>HOGWARTS </strong>of my life.</p><p>Yes, you read it right <strong>Hogwarts — the magic school</strong>, and it’s none other than “<strong>Masai School</strong>”.</p><p>Today I want to share my journey to Masai School, how I got to know about it, what convinced me to take admission into it, and how I got admission.</p><p>I was looking for an online boot camp as I was getting updated the way the IT sector of our country growing day in day out post-pandemic era. As Yogesh(co-founder of Masai School and our own Professor Dumbledore) says that you get rewarded when you do the right things-right place-right time this is exactly what I was feeling. I am from a civil engineering background and wanted to switch to IT.</p><p>So, I was searching and searching, had joined various platforms, and all of sudden I got an advertisement on Instagram about Masai School. Out of curiosity I just clicked on the link and started learning about it. The more I read the more I got amazed. Each and every point was totally convincing.</p><p>So, I started doing more research about it and I figured out various factors to get enrolled. I am one by one sharing all of them:</p><p>i) <strong>No Upfront Fee</strong>: No one in this whole country is providing such a quality education without taking money in advance and still no guarantee of success.</p><p>ii) <strong>The I.S.A</strong>.(Income Sharing Agreement): You just have to share 15% of your salary if you get placed above the slab of 5LPA within a period of 1 year after completing the course otherwise no fee at all until you reach a sum of 3lacs. (<a href="https://youtu.be/25wTBGYVk2w">https://youtu.be/25wTBGYVk2w</a>)</p><p>iii) <strong>The Glide Program</strong>: Facilitation of financial assistance to the students if you need it. Masai School gives rs.10000/month so that you can devote your 100 percent.( <a href="https://youtu.be/Hx-7wHlHbZM">https://youtu.be/Hx-7wHlHbZM</a>)</p><p>iv) <strong>Placement Record: </strong>For the last 7 batches Masai School is having a record of 100% placement and an overall 97.5% placement record.</p><p>v) <strong>Campus facility: </strong>Those who don’t have a working environment where they live can avail of this facility at any of its various campuses.</p><p>After getting the surety I enrolled myself and gave the required tests i.e. MSAT1 and MSAT2, these exams were based on quantitative aptitude, logical reasoning, scanning(reading) skills. I, fortunately, cleared both the exams but if you try and could not clear the cut-off here is a catch for you. You don’t have to worry about it as Masai runs a separate batch for those students whom Masai feels that this student requires assistance in basics like elementary math and logic building. This is something that I didn’t know before getting admission so I was worried before the results of MSAT2 were declared and got the selection. Now, why this separate batch? Because Masai ensures to give you equal opportunity regardless of your background.</p><p>After spending more than 2 and a half weeks in Masai I can say for sure that Masai is beyond my expectations, the quality team they have, the level of assistance they provide to each and every student is just amazing.</p><p>After the session of nested loops, I am getting the feeling that the journey is not going to be easy but when the going gets tough the tough get going. And I am the toughest one.</p><p>It’s time for Harry Potter to learn the magic.</p><p>At last, I want to thank Masai school, you are literally going to transform the education system of our country.</p><p>Loads of love and best wishes to you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=736e6b6c9172" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>