<?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: Hello Dev World Blog</title>
    <description>The latest articles on DEV Community by Hello Dev World Blog (@hellodevworldblog).</description>
    <link>https://dev.to/hellodevworldblog</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%2F547634%2Ffc7e5b23-075e-433b-baf8-37e49f6f883a.jpg</url>
      <title>DEV Community: Hello Dev World Blog</title>
      <link>https://dev.to/hellodevworldblog</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hellodevworldblog"/>
    <language>en</language>
    <item>
      <title>5 Web Development Languages to learn in 2023</title>
      <dc:creator>Hello Dev World Blog</dc:creator>
      <pubDate>Tue, 10 Jan 2023 04:04:47 +0000</pubDate>
      <link>https://dev.to/hellodevworldblog/5-web-development-languages-to-learn-in-2023-1kg5</link>
      <guid>https://dev.to/hellodevworldblog/5-web-development-languages-to-learn-in-2023-1kg5</guid>
      <description>&lt;p&gt;It's that time of year again to start thinking about what you want to learn this year! &lt;/p&gt;

&lt;p&gt;These are my top 5 languages for web developers that I would suggest learning in 2023&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;JavaScript/Typescript (shocker I know)&lt;/li&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;Java &lt;/li&gt;
&lt;li&gt;Go&lt;/li&gt;
&lt;li&gt;Kotlin&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I will also put a bonus one at the end ;p &lt;/p&gt;

&lt;h2&gt;
  
  
  1. JavaScript/TypeScript
&lt;/h2&gt;

&lt;p&gt;according to Stackoverflow (and many others), JavaScript is one of the most commonly used languages in the world. It is a fun language that can be used for both the front end and back end. It has an extensive open library system that you can contribute to (open source). This is both good and bad because there is very little quality control but it opens some interesting opportunities and allows people’s imaginations to run wild. There are packages for everything! It is always fun to see what people come up with. &lt;/p&gt;

&lt;p&gt;TypeScript has been exploding in the past few years as well. It is a superset of JavaScript meaning it adds an extra layer on top of javascript and compiles it down to javascript. It allows you to add static typing to your projects! &lt;/p&gt;

&lt;p&gt;There is a HUGE demand for JavaScript/TypeScript devs as well. According to this study (and a few others) it is the number 1 most in-demand language last year. No matter what study you look at its almost always in the top 3. &lt;/p&gt;

&lt;h2&gt;
  
  
  2. Python
&lt;/h2&gt;

&lt;p&gt;Python has been around forever and you have probably already spent a little time learning Python as most colleges, high schools, and some code camps use it to teach people the basics. It is a great language and has been a steady contender for a long time. It is continuing to climb in popularity again and people who work in ML and deal with large sets of data seem to use it a lot. &lt;/p&gt;

&lt;p&gt;it is a great language to have in your toolbelt with a high demand on the job market. No matter what study you look at it is almost always in the top 5 most in-demand languages from last year.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Java
&lt;/h2&gt;

&lt;p&gt;Another language that has been around forever that you may know from schooling. You would be amazed how many companies still use Java and actively add new applications using Java every day. &lt;/p&gt;

&lt;p&gt;Java has been around for a long time and there is a lot of good online support. It has been like Python which has been steady since it came out and definitely isn’t going anywhere. If you are a web developer that does not know Java it would be a great language to add to your arsenal.  &lt;/p&gt;

&lt;p&gt;it is also in high demand in the job market. No matter what study you look at it is almost always in the top 5 most in-demand languages from last year.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Go
&lt;/h2&gt;

&lt;p&gt;oh, go…. Go is a language I was never super fond of and people seem to either love it or hate it. BUT the fact of the matter is it’s very popular and the popularity is growing. It is a fast language that people are finding new uses for all the time. It used to be more barebones than it is now (as designed they wanted it to be light and fast) but they have since added a bit more built-in functionality. There is also more and more online support for it every day. It is definitely an interesting one to check out and see if you like it!&lt;/p&gt;

&lt;p&gt;also to mention it is in the top 10 of most on-demand languages for multiple studies.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Kotlin
&lt;/h2&gt;

&lt;p&gt;Kotlin isn’t on any of the top in-demand lists but a language that I find very interesting. It seems to be gaining a bit of momentum and everyone that I know that uses it loves it. It is relatively new and there isn’t as much support online but there is still some out there. I don’t foresee it going anywhere anytime soon and just think it is an interesting language for someone to look into/learn that could become more popular in the upcoming years&lt;/p&gt;

&lt;h2&gt;
  
  
  BONUS! - Rust
&lt;/h2&gt;

&lt;p&gt;if you want to start going a little past web development or a language that can go with web development definitely check out Rust. It is relatively new and is gaining momentum. It is a really cool fun lower-level language that people are finding new uses for all the time. It is more fun than C and is super fast and powerful. If you have extra time and you want to start playing around with lower-level languages definitely give Rust a try!&lt;/p&gt;

&lt;p&gt;There are many more and I didn't list a lot of still very popular languages such as C#, Ruby, and PHP definitely comment down below what languages you would suggest people learn! there are so many options!&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>developers</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Best Laptops for Software Development in 2023</title>
      <dc:creator>Hello Dev World Blog</dc:creator>
      <pubDate>Sun, 08 Jan 2023 04:43:16 +0000</pubDate>
      <link>https://dev.to/hellodevworldblog/best-laptops-for-software-development-in-2023-1581</link>
      <guid>https://dev.to/hellodevworldblog/best-laptops-for-software-development-in-2023-1581</guid>
      <description>&lt;p&gt;&lt;em&gt;This post contains affiliate links. If you use these links to buy something I may earn a commission. Thanks.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So I often get asked what the best computer for doing software development is and I kind of hate that question because the answer is it depends. Are you only going to use it for software development? What else do you want to do on it? What operating system do you want? What kind of development are you going to be doing? So ya. It depends and arguably you could do development from just your phone. Nothing special needed. However, I will do my best to make a top 5 list of best laptop choices for software development (in no particular order).&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;a href="https://amzn.to/3CubXqX"&gt;MacBook Pro 16”&lt;/a&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Okay so this is a hot topic but I love using a MacBook for development. I’ve been using them for years and never had issues. It’s also a must-have if you are doing ruby development as you may run into issues with it on a PC. I actually just bought this computer for myself this year. &lt;/p&gt;

&lt;p&gt;I went with &lt;a href="https://amzn.to/3CubXqX"&gt;the 16“&lt;/a&gt; because I like as much screen as I can get! You can never have too much real estate when developing especially for web developers. I also got it because it came standard with the M1 Pro chip which you need if you want to natively support multiple external screens and I have 2. &lt;/p&gt;

&lt;p&gt;if you want to natively support 2 external monitors you will need to at least go with the 14“ MacBook pro there are external devices like &lt;a href="https://amzn.to/3ZkVGOA"&gt;this one&lt;/a&gt; or &lt;a href="https://amzn.to/3Gm5yiI"&gt;this one&lt;/a&gt; you can get with the &lt;a href="https://amzn.to/3GLpkFy"&gt;13” MacBook Pro&lt;/a&gt; or &lt;a href="https://amzn.to/3X8jKCA"&gt;2022 MacBook Airs&lt;/a&gt; without the pro chip but its another external item you need to get that can be pricey.&lt;/p&gt;

&lt;p&gt;If you are looking to do App development and want to support apple devices an &lt;a href="https://amzn.to/3cBs74K"&gt;iMac&lt;/a&gt; or &lt;a href="https://amzn.to/3CubXqX"&gt;MacBook Pro&lt;/a&gt; will be a must-have as you need them to compile your apps and release them to the store. If you are a game engineer the screens on the &lt;a href="https://amzn.to/3CubXqX"&gt;MacBooks&lt;/a&gt; are incredible and with the new M1 chips (or M2 depending on which you go with) you shouldn’t have any issue with processing power although they may run a little hot. I also get the higher RAM and storage because I would rather have more and not need it than need it but not have it.&lt;/p&gt;

&lt;p&gt;One thing to note this year (and 2022/2023 models) is they made them significantly thicker and heavier so its something to keep in mind if that is a big deal for you&lt;/p&gt;

&lt;p&gt;also using &lt;a href="https://amzn.to/3CubXqX"&gt;this link&lt;/a&gt; will save you at least $300 at the time of posting :) &lt;/p&gt;

&lt;p&gt;Pros:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fast&lt;/li&gt;
&lt;li&gt;reliable&lt;/li&gt;
&lt;li&gt;great operating system that integrates with other apple devices&lt;/li&gt;
&lt;li&gt;great Display&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HEAVY&lt;/li&gt;
&lt;li&gt;have to spend more for the M1 pro chip if you want to natively support multiple external screens&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;a href="https://amzn.to/35fsUEi"&gt;Acer Predator Triton 500 SE&lt;/a&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you are leaning more towards a pc the &lt;a href="https://amzn.to/35fsUEi"&gt;Acer Predator Triton 500 SE&lt;/a&gt; is a great choice. I love this laptop because is a beast and still portable. It is a great laptop for traveling because you can do work and gaming on the laptop. If you want a lot of power in a small laptop this is a great choice. The screen is also amazing. It also has plenty of processing power for the game developers and a great screen for them to work on. If you are doing .NET development (not core but anything other than core) you will want to opt for a PC as you won’t be able to do it on a mac. Again I opt for the higher ram and if possible get more storage. I also opt for &lt;a href="https://amzn.to/3XfX03J"&gt;the 3080&lt;/a&gt; instead of &lt;a href="https://amzn.to/3VNfS8R"&gt;the 3070&lt;/a&gt; because I use it for gaming and would rather have the power than not. It is also usually in stock while &lt;a href="https://amzn.to/3VNfS8R"&gt;the 3070&lt;/a&gt; can be hard to find. The extra power is also a must if you are going to be doing game development or video processing.&lt;/p&gt;

&lt;p&gt;Pros:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fast&lt;/li&gt;
&lt;li&gt;can be used for gaming&lt;/li&gt;
&lt;li&gt;powerful&lt;/li&gt;
&lt;li&gt;great option for .Net developers (not using core)&lt;/li&gt;
&lt;li&gt;great graphic card&lt;/li&gt;
&lt;li&gt;good amount of storage&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;shorter battery life than others&lt;/li&gt;
&lt;li&gt;16” can be big for some people&lt;/li&gt;
&lt;li&gt;heavier than others &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;a href="https://amzn.to/3Gl86NX"&gt;Asus ROG Zephyrus﻿﻿ G15&lt;/a&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This is actually the current laptop that I have as my travel laptop. It is such a beast of a computer for a great price. It isn’t too heavy and has enough power for gaming as well as web development. If you want the best screen around this isn’t the best choice you get a lot for your money with this laptop. You get a great amount of storage and RAM in a small laptop for around $2000. I have last years’ version and since then they have unfortunately raised the prices I think due to the expense of the new graphics cards but I still think this years’ is a great choice for a great price. They do have a &lt;a href="https://amzn.to/3jWEJdc"&gt;cheaper option with a 3060 instead of a 3070&lt;/a&gt; personally I think it’s worth the extra for the better graphics card but I also play some graphics-intensive games. Again if you are doing .NET development (not core but anything other than core) you will want to opt for a PC as you won’t be able to do it on a mac. &lt;/p&gt;

&lt;p&gt;Pros:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fast&lt;/li&gt;
&lt;li&gt;can be used for gaming&lt;/li&gt;
&lt;li&gt;powerful&lt;/li&gt;
&lt;li&gt;great option for .Net developers (not using core)&lt;/li&gt;
&lt;li&gt;good graphics card&lt;/li&gt;
&lt;li&gt;good amount of storage&lt;/li&gt;
&lt;li&gt;affordable (especially the 3060 option)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;shorter battery life than others&lt;/li&gt;
&lt;li&gt;heavier than others &lt;/li&gt;
&lt;li&gt;some people complain about the backlight on the keyboard&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;a href="https://amzn.to/3ZaiG2O"&gt;Dell XPS 15&lt;/a&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you are a .Net developer or work in a PC shop you will most likely have used this before or may currently be using it. Say what you will about dell but I never had issues developing on an &lt;a href="https://amzn.to/3ZaiG2O"&gt;XPS&lt;/a&gt;. They are a super solid option if you are doing web development as they are plenty powerful but don’t have all the bells and whistles that you pay extra for in other computers. I don’t think they are the best option for gaming devs or people who want to also use their laptops for gaming but if you just want to use your computer for development this is a very solid option and a total powerhouse for the money.&lt;/p&gt;

&lt;p&gt;Pros:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fast&lt;/li&gt;
&lt;li&gt;reliable&lt;/li&gt;
&lt;li&gt;great option for .Net developers (not using core)&lt;/li&gt;
&lt;li&gt;lots of storage for the money&lt;/li&gt;
&lt;li&gt;good processor for the money&lt;/li&gt;
&lt;li&gt;can be upgraded&lt;/li&gt;
&lt;li&gt;very portable&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;not great for gaming&lt;/li&gt;
&lt;li&gt;cooling isn’t great&lt;/li&gt;
&lt;li&gt;CPU throttles pretty quickly&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;&lt;a href="https://amzn.to/3vPsEZS"&gt;Lenovo ThinkPad P15s Gen 2&lt;/a&gt;&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This a great very portable option. They are lighter than a lot of the other computers mentioned. They aren’t a powerhouse like the previously mentioned laptops but unless you are needing a lot of processing power (game development, gaming, video editing, big data processing (I don’t know why you’d do this on a laptop)) you don’t need it. This option is more affordable and still very nice&lt;/p&gt;

&lt;p&gt;Pros:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;affordable&lt;/li&gt;
&lt;li&gt;nothing more than you need&lt;/li&gt;
&lt;li&gt;very light and portable&lt;/li&gt;
&lt;li&gt;good option for .Net developers (not using core)&lt;/li&gt;
&lt;li&gt;good storage&lt;/li&gt;
&lt;li&gt;durable&lt;/li&gt;
&lt;li&gt;can be upgraded&lt;/li&gt;
&lt;li&gt;battery life&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;not for gaming&lt;/li&gt;
&lt;li&gt;looks kind of old (still has the mouse in the center of the keyboard)&lt;/li&gt;
&lt;li&gt;cooling isn’t great&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope this helps you when deciding on your next laptop you really can’t go wrong with any of the options just keep in mind the type of development you want to do and what else you may want to do on the laptop.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>career</category>
    </item>
    <item>
      <title>You Aren’t Going to Need It (YAGNI) Principle Explained</title>
      <dc:creator>Hello Dev World Blog</dc:creator>
      <pubDate>Wed, 16 Nov 2022 05:53:50 +0000</pubDate>
      <link>https://dev.to/hellodevworldblog/you-arent-going-to-need-it-yagni-principle-explained-2ed4</link>
      <guid>https://dev.to/hellodevworldblog/you-arent-going-to-need-it-yagni-principle-explained-2ed4</guid>
      <description>&lt;p&gt;A long time ago I read this great article from Martin Fowler explaining what YAGNI was. When I brought up this principle to a couple people the other day they had never heard of it. It seems more than ever with so many people coming out with “the right way” to do things and so many different options that are becoming available to come back and remember this principle.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;YAGNI - You aren’t going to need it&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You may look at this principle and say “well duh” OR you may be one of those people who look at it and say well what if you do that’s why we implement things to begin with to make our future lives easier. You also may think this may be pretty straight forward. But think how many times in the last week have you implemented something because you thought you MIGHT need it or implemented something in a way that may have been more complicated but it was more open ended so if you wanted to add something to it later you could.&lt;/p&gt;

&lt;h2&gt;
  
  
  Premature optimization/implementation
&lt;/h2&gt;

&lt;p&gt;That leads us to one of the things this principle tries to keep us away from which is premature optimization or implementation. There is no reason to implement something more complicated just so that down the road you may be able to make it more flexible. This makes the code more unmaintable and can lead to more complication by trying to make it fit too many scenarios rather than the scenario it was originally intended for. We see this a lot with API endpoints where we build these endpoints that can accept everything and do everything based off flags when really the endpoints should be very specific to the exact information you need.&lt;/p&gt;

&lt;p&gt;This goes hand in hand with premature optimization. If you think something may be reusable don’t make it reusable until it needs to be don’t add a layer of complication and abstraction just because you think in the future it may be reusable. Make it reusable when the A/C calls for it and no sooner.&lt;/p&gt;

&lt;p&gt;YAGNI even goes as far as to say even if you know its in the pipeline for a quarter or two down the road don’t implement it until you need to. Right now implement what you know needs to be implemented. Get the feature out. When you need to implement the next part of it update it as needed then. Don’t make it more complicated now for the potential in the future just get the feature out.&lt;/p&gt;

&lt;h2&gt;
  
  
  It’s a bit extreme
&lt;/h2&gt;

&lt;p&gt;YAGNI as a principle I think is really great and something we should all be keeping in the back of our minds. Rather than building these crazy applications that can do a million things with ease of potential future in mind we should be trying to tackle the issues in front of us. However, YAGNI as a principle as layer out in ExtremePrinciples is just that… Extreme. It takes to to a level that you have to start outweighing the cost of those decisions (just like any other decision including going the non YAGNI route). It can be very costly both time and effort to not keep the future in mind when building out applications. The cost and effort of refactoring to allow for certain things in the future can be a huge lift with a lot of dev time. &lt;/p&gt;

&lt;p&gt;This trade-off is something that Martin Fowler mentions at the bottom of his article as well. Sometimes it can cause an issue to be too strict and to not take the future into consideration.&lt;/p&gt;

&lt;h2&gt;
  
  
  So do I follow YAGNI?
&lt;/h2&gt;

&lt;p&gt;Yes and no. While I think YAGNI as a principle is a great concept I lean more in the middle of the road. I think not bringing in libraries until they are needed, or not making things optimized/reusable until they need to be is something really important that we should all keep in mind while developing. While trying to account for all future possibilities is great it also comes as a cost of having to support that extra functionality that is usually more complicated just so that maybe one day it can be flexible IF you need it. I think there should be a balance just like everything else&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>career</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Top 5 VS Code (Visual Studio Code) Extensions Every Developer Should Have</title>
      <dc:creator>Hello Dev World Blog</dc:creator>
      <pubDate>Mon, 03 Jan 2022 15:38:57 +0000</pubDate>
      <link>https://dev.to/hellodevworldblog/top-5-vs-code-visual-studio-code-extensions-every-developer-should-have-5ag6</link>
      <guid>https://dev.to/hellodevworldblog/top-5-vs-code-visual-studio-code-extensions-every-developer-should-have-5ag6</guid>
      <description>&lt;p&gt;Throughout the years I have tried a lot of different Visual Studio Code extensions but there are a few extensions that I always download with every new computer and struggle to work without.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens"&gt;GitLens&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This extension is by far the most useful extension in VS Code. Most people use it just to see inline who made the last commit for each line and what the commit message was. HOWEVER, what most people don’t know is it also lets you see each commit diff that has been made on that file and the changes that were made. This makes it really easy to see where an issue may have occurred and where you should start debugging at, what mistakes you had made, or potentially what changes you have made locally that may have caused an issue. It can also give you some insight about the progression of the file to get a better understanding of requirements and so you don’t fall into the same traps someone before you may have already fallen into.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. &lt;a href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint"&gt;ESLint&lt;/a&gt;/&lt;a href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode"&gt;Prettier&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Depending on your setup or your team’s setup you may use ESLint, Prettier, or both. This extension makes it really easy to see where your mistakes are, gives you a point and click the option to fix most of them, and auto formats for you. These are based on rules your set or the default rules that they provide for you. This helps keep your code clean and readable and can help you figure out where you may be. missing that stupid bracket since your format will start looking off once it hits that spot that is missing one.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. &lt;a href="https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer"&gt;Bracket Pair Colorizer&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Speaking of a missing bracket… This extension colors your brackets and parens n pairs. This makes it easier to see where all your brackets are and which bracket they match up to. This makes it easier to see where you may be missing one and can help you see where your functions are efficiently.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. &lt;a href="https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets"&gt;React&lt;/a&gt;/&lt;a href="https://marketplace.visualstudio.com/items?itemName=sdras.vue-vscode-snippets"&gt;Vue&lt;/a&gt;/&lt;a href="https://marketplace.visualstudio.com/items?itemName=johnpapa.Angular2"&gt;Angular&lt;/a&gt; snippets
&lt;/h2&gt;

&lt;p&gt;Whichever library you are working with I strongly suggest you download the snippets for them. They will help you with formatting and will give you the formats for things like imports, functions hooks, etc. by starting to type what you want and pressing “tab”. It will be a huge time saver!&lt;/p&gt;

&lt;h2&gt;
  
  
  5. &lt;a href="https://marketplace.visualstudio.com/items?itemName=jonkwheeler.styled-components-snippets"&gt;Styled-components snippets&lt;/a&gt;/&lt;a href="https://marketplace.visualstudio.com/items?itemName=mrmlnc.vscode-scss"&gt;SCSS Intellisense&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This one is another time-saver. It will show you where your errors may be, attributes that don’t exist that you may have written, and can help you again with formats. The styled-components one is very helpful because without it the code editor will not catch any errors or wrong attributes in your styled components files because the code editor doesn’t know how to check it. This will save you so much time when you accidentally spell something wrong or use the wrong casing like “alignItems” instead of “align-items“.&lt;/p&gt;

&lt;h2&gt;
  
  
  BONUS - &lt;a href="https://marketplace.visualstudio.com/items?itemName=christian-kohler.path-intellisense"&gt;Path Intellisense&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This extension can save you so much time on your imports. Instead of having to track down where your files are this will bring in the path for you. This can get a little tricky/not work with scoped imports but other than that works like a charm. This is also great because you can set it to bring in the import when you try to use something that hasn’t been imported yet. Again you have to be careful with scoped imports but this extension is great.&lt;/p&gt;

&lt;h2&gt;
  
  
  BONUS 2!- &lt;a href="https://marketplace.visualstudio.com/items?itemName=akamud.vscode-theme-onedark"&gt;Atom One Dark Theme&lt;/a&gt; and &lt;a href="https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme"&gt;Material Icons&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Let’s be real. Everyone knows the most important part of your code editor is the theme. I use the Atom One Dark theme. I just like the color palette especially for all the different languages I use the color structure just works well for me and makes it easier to read. I also download the Material icons extension because I think they just look better.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>programming</category>
      <category>tooling</category>
    </item>
    <item>
      <title>5 Tips To Improve Your JavaScript Debugging Skills and Save You Time</title>
      <dc:creator>Hello Dev World Blog</dc:creator>
      <pubDate>Mon, 27 Dec 2021 19:52:33 +0000</pubDate>
      <link>https://dev.to/hellodevworldblog/5-tips-to-improve-your-javascript-debugging-skills-and-save-you-time-4pfd</link>
      <guid>https://dev.to/hellodevworldblog/5-tips-to-improve-your-javascript-debugging-skills-and-save-you-time-4pfd</guid>
      <description>&lt;h2&gt;
  
  
  1. Become comfortable using your browser inspector
&lt;/h2&gt;

&lt;p&gt;If you are doing web developer or even some app development your web browser will be your best friend and worst enemy. But you know what they say if you can’t beat them join them. But in all seriousness learning how to take advantage of the inspector your browsers have given you will help you immensely. &lt;/p&gt;

&lt;p&gt;If you have never used the inspector if you right-click on any webpage there will be an option at the bottom of the menu that pops up called “inspect” this will bring up a window. This window will show you the webpage’s code and allow you to interact with it. You can change CSS, there is a console to test javascript code, and you can see how your compiler is compiling your code into HTML. &lt;/p&gt;

&lt;p&gt;Learning how to use this will allow you to quickly understand if your code isn’t rendering the way you think it should. Most importantly you can mess with your styling all you want, see it update right away, and if you really mess it up you can just refresh and it’ll be back to the code from your editor. You can also just turn certain styling off and on to test certain attributes. This makes the painstaking styling debugging so much easier and faster. &lt;/p&gt;

&lt;p&gt;This is also where your code breaks (debugger) will show up if you set them up. The console allows you to test your Javascript code and variables at the time of where your debugger stopped. This allows you to quickly and easily test your javascript state and variables while it is running if you are having state issues and don’t want to mess with a bunch of console logs or if they aren’t helpful. It also has helpful information within the debugger for state and allows you to step through the code line by line.&lt;/p&gt;

&lt;p&gt;If you think you are not receiving the data you are expecting or if you are not understanding what is going on with an API check out the network tab. This will show you all of your API calls and their responses. This will help you understand why a call may be failing or if the API is sending the wrong data or you aren’t handling that data properly.&lt;/p&gt;

&lt;p&gt;You definitely need to become one with the inspector it will make you so much more productive.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Use console logs
&lt;/h2&gt;

&lt;p&gt;Using console logs can be very helpful if you aren’t sure exactly why or where something is breaking. It can be helpful to see if you are even getting into a function that you aren’t sure is getting hit, testing out some logic that may not be acting as expected, or even state or props something is receiving that may not be working as expected.&lt;/p&gt;

&lt;p&gt;Using console logs can get messy very quickly and can easily become hard to trace. To make it a little easier I always add a line number. For instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;12 being the line number. The number turns a different color so it makes them easier to see. It also points to what line number your log is on so they don’t get confusing. If there are multiple files it may be easier to add the file name in the console log as well. such as,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`nav bar file: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;codeToTest&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Having helpful console logs will make things much easier, faster, and less frustrating. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;3. Download helpful tools for your code  editor&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;No matter what code editor you use you should be able to download extensions or tools to help you be more efficient. Downloading the tools for the file you are using and linting tools can help you catch errors before even running your code. This can also help you trace where code is being used both in and outside your file which can help track down areas that also may be affected by your changes.&lt;/p&gt;

&lt;p&gt;Some extensions I use are (you can read more about them &lt;a href="//hellodevworld.com/misc/5-vscode-extensions-every-frontend-developer-should-have"&gt;in this article&lt;/a&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode"&gt;Prettier&lt;/a&gt; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint"&gt;ESLint&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=abusaidm.html-snippets"&gt;HTML Snippets &lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=dsznajder.es7-react-js-snippets"&gt;ES7 React/Redux/GraphQL/React-Native snippets&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens"&gt;GitLens&lt;/a&gt; - allows you to quickly and easily cycle through previous commits for files - SUPER helpful&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=mrmlnc.vscode-scss"&gt;SCSS Intellisense&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=jonkwheeler.styled-components-snippets"&gt;styled-components snippets&lt;/a&gt; - super helpful if you use styled-components&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.vscode-remote-extensionpack"&gt;Remote extensions&lt;/a&gt; (not a debugger one just great also may need multiple to fully work) - for VS Code allows you to code off a server rather than your local computer keeps all your snippets and code in one place without having to worry about what computer you are on&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Download helpful tools for your web browser
&lt;/h2&gt;

&lt;p&gt;Most browsers (especially chrome) have tools you can download for your browser to help make your life easier. If you are using React or Vue I strongly recommend you download their respective tools. These tools give you great insight into your store/state and also have built-in debuggers. These extensions will help you debug your React and Vue project much faster.&lt;/p&gt;

&lt;p&gt;There are other tools as well for testing things like CORS, APIs (through postman), and viewing JSON. You can get JSON formatters, Postman extensions, and tools that allow you to turn CORS off and on. These all make it faster to test things all in one place, read your responses more easily, and quickly toggle settings without having to change any code or wait for a rebuild. Here are some of the extensions that I use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa"&gt;JSON Formatter&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://chrome.google.com/webstore/detail/allow-cors-access-control/lhobafahddgcelffkeicbaginigeejlf"&gt;CORS Toggler&lt;/a&gt; - adds Access-Control-Allow-Origin: * rule to the response header.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi"&gt;React Developer Tools&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://chrome.google.com/webstore/detail/postman-interceptor/aicmkgpgakddgnaphhhpliifpcfhicfo"&gt;Postman Interceptor&lt;/a&gt; - Sends requests fired through the Postman chrome app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd"&gt;Redux DevTools&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://chrome.google.com/webstore/detail/vuejs-devtools/nhdogjmejiglipccpnnnanhbledajbpd"&gt;Vue.js devtools&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://chrome.google.com/webstore/detail/git-patch-viewer/hkoggakcdopbgnaeeidcmopfekipkleg"&gt;Git Patch Viewer&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. Understand how the language you are working in works
&lt;/h2&gt;

&lt;p&gt;This one may sound odd but better understanding how the language you are working in works under the hood can make debugging much easier. Knowing how your language rerenders, how the loops work, how async works, all helps to understand why certain errors may be happening. It will help you understand why a loop may happen too many times, why your state isn’t quite what you expect, or why data may not be coming back when you expect. Taking the time to understand &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>debugging</category>
      <category>webdev</category>
      <category>tooling</category>
    </item>
    <item>
      <title>JavaScript Beginners Guide - Array</title>
      <dc:creator>Hello Dev World Blog</dc:creator>
      <pubDate>Fri, 06 Aug 2021 22:40:07 +0000</pubDate>
      <link>https://dev.to/hellodevworldblog/javascript-beginner-guide-array-37ie</link>
      <guid>https://dev.to/hellodevworldblog/javascript-beginner-guide-array-37ie</guid>
      <description>&lt;p&gt;Here is a printable guide to arrays. These are commonly used simple array functions and how they work with examples.&lt;/p&gt;

&lt;p&gt;This is the first of a new series I am doing let me know if there is a better format you would prefer!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Kcr-x2F2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/elav5fyk3nrqaqveme5m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Kcr-x2F2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/elav5fyk3nrqaqveme5m.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>learning</category>
    </item>
    <item>
      <title>Top Senior Front End Engineer Interview Questions and Answers (React Focused)</title>
      <dc:creator>Hello Dev World Blog</dc:creator>
      <pubDate>Sun, 01 Aug 2021 16:49:22 +0000</pubDate>
      <link>https://dev.to/hellodevworldblog/senior-front-end-engineer-interview-questions-and-answers-react-focused-1jk7</link>
      <guid>https://dev.to/hellodevworldblog/senior-front-end-engineer-interview-questions-and-answers-react-focused-1jk7</guid>
      <description>&lt;p&gt;The tech world is starting to have a new appreciation for solid senior front-end engineers. There are more jobs available for people who specialize on the front end with higher salaries than before. So what is expected of a senior front-end engineer? This is a subjective question but in my opinion, a senior front-end engineer should know how everything works under the hood, why you would make certain architectural decisions over others, and be able to get in the weeds of the code and contribute heavily without much help. &lt;/p&gt;

&lt;p&gt;So you might be asking what kinds of questions get asked in a senior engineer interview. This is again subjective and depends on who is interviewing you and what company you are applying to. But here are some of the questions I like to ask or have been asked and things I look for in an answer. Keep in mind these are not coding challenges I will have another post on what you may come across for those.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. What is your philosophy on reusable components vs simplicity and premature optimization? 
&lt;/h2&gt;

&lt;p&gt;Note: this question’s answer is more subjective than most of the other questions. These are the things I and all my teams in the past have looked for.&lt;/p&gt;

&lt;p&gt;We always want to make components small and reusable but we don’t want to get carried away. Simplicity and readability are key. Don’t overcomplicate if you don’t have to. Generally make it reusable when you need to but keep reusability in mind when creating it. &lt;/p&gt;

&lt;p&gt;There are components you know even in the beginning stages of your application will be reused. For instance, navigation, maybe a dropdown, or a table component, or pagination. If the component is super specialized then it likely won’t be reused but try to make it as reusable as possible. Think about ways it can be reused if possible but if it adding too much extra complexity just build it for what needs to be done at the time. Sometimes making something reusable makes it too complex, bug prone, and hard to support. If that is the case look into ways to make it simpler or make a new component to support some edge cases. &lt;/p&gt;

&lt;h2&gt;
  
  
  2. How would you explain a useEffect to a junior engineer?
&lt;/h2&gt;

&lt;p&gt;Here we get to know the understanding of if they know what a useEffect is, how it works, and if they can explain a difficult concept to a junior.&lt;/p&gt;

&lt;p&gt;A useEffect hook is a function that executes based off the dependency array that it is given. So if you have something you want to happen when something in your state changes you would put it in a useEffect. If anything in that array changes the function will run. If you only want it to run once you pass it an empty array, and if you want to do something when the component is unmounts you add a return statement to the useEffect and it will run when the component unmounts.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. What are major pitfalls or common issues people face with hooks?
&lt;/h2&gt;

&lt;p&gt;Unwanted rerenders. People make hooks with too many dependencies with a lot of complex logic and it makes the component rerender too many times and sometimes creates infinite loops. You need to be intentional about what is in your hooks and the dependency array for them. You want as few dependencies as possible. Some linters will complain if you don’t have each thing you use in your hook in your dependency array which I think is fair but you also have to be willing to ignore the linter sometimes and know exactly what you want to trigger that function and only have that in the dependency array. Arguably though this shouldn’t be necessary if your hooks are written correctly as they shouldn’t have to depend on many things and the component should need to rerender when the things in the hook change otherwise why are they in the hook? (you could just put them in a constant instead) but there are SOME cases where this is unavoidable (this is a common hotly debated topic).&lt;/p&gt;

&lt;h2&gt;
  
  
  4. If you are getting too many API calls being made from your hooks what can you do to prevent this?
&lt;/h2&gt;

&lt;p&gt;Use a caching system or package to help. You can set something in state that checks if the call is different from the last call if it is then make the call otherwise don’t and then if you want new data each time the page is hit clean that up in the return of your useEffect otherwise leave it in global state so you don’t have to make the call again if you have the data. You can also use a package like React Query (there are also other packages you can use) to help you take care of the caching for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Explain the javascript event loop (also may get explain how promises or async await work in js these are basically all the same question/answer)
&lt;/h2&gt;

&lt;p&gt;JS has a call stack that everything synchronously goes into. When you hit a function that there is a Web/Browser/Node APIs for (document, http request, or timeout), JS will pass that to the Web/Browser/Node APIs to handle. When they are done being evaluated they get pushed back to the callback queue. The callback queue is a queue of all the callback functions that are ready to be executed. If the call stack is empty js will look at the callback queue to execute those callback functions. &lt;/p&gt;

&lt;p&gt;If there is a promise (async await is just a promise under the hood) they will be pushed into a microtasks queue. This queue works a lot like the callback queue but is given priority over the callback queue. This means if you had an async call and a setTimeout the async callback will get executed before the setTimeout.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why should we not directly update state (using DOM manipulation)?
&lt;/h2&gt;

&lt;p&gt;When you manipulate the DOM directly react loses its connection to that update. If we use React to set state it schedules an update to the components state object when that changes the component will rerender. React becomes unaware of the update and will no longer update properly based on the state of that component. Or if you are adding an element that React was never aware of you won’t be able to rerender that element based off the state of your application. &lt;/p&gt;

&lt;h2&gt;
  
  
  6. What are a couple of easy to avoid front-end security pitfalls?
&lt;/h2&gt;

&lt;p&gt;I could write a whole article about this so if you want more information let me know I’m happy to do a more in depth article on this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cross-site scripting&lt;/strong&gt; - react actually has some of this built-in it will escape XSS (so does Ruby on Rails). Using CSPs (content security policies), sanitizing your incoming data and data you are sending to the backend.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Injection&lt;/strong&gt; - this is again sanitizing your incoming data and the data you are sending to the backend to make sure there are no queries that can be sent. This can also go along with the front end not being able to send a query to the backend. The backend shouldn’t expect a query the front end should send the necessary data the backend needs to create the query. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Broken Auth&lt;/strong&gt; - this can be the ability to bypass auth by using the URL to hit certain pages rather than going through the expected route, having misconfigured CORS, allowing the user to easily update a value from the front end to access something they don’t have access to. There are many things that can go wrong here but a couple ways to fix it are, rate limiting your APIs (this is mainly to protect against automated attacks or brute forcing), making sure you have all protected routes (maybe a middleware that makes someone be authentic for every page or making sure all routes have auth around them that should), make sure you have proper auth (don’t allow your JWTs to live too long, don’t allow a user to just have access because they have a certain Id ensure there are other checks for auth as well). There is a lot more that goes into this. &lt;/p&gt;

&lt;p&gt;There are many more if you want to know more check out the OWASP top 10.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. What is Virtual DOM and how does it work?
&lt;/h2&gt;

&lt;p&gt;The virtual DOM is a JavaScript version of the actual DOM that is saved in memory and syncs with the actual DOM to make things react on the page. Through libraries you are able to make JavaScript manipulate the actual DOM based off the state you want and define in JavaScript. The libraries do this by using an algorithm that looks at the difference between the state you want and the state of the actual DOM in a tree structure (will start from the root and move in). It will update anything that is different and the children below it if necessary. &lt;/p&gt;

&lt;p&gt;You could go in to how it looks at class names and styling but it depends on what they want. Here is React’s article on how their reconciliation process works. Vue’s works similarly but here is the article on how theirs works.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. What is the difference between Shadow DOM and Virtual DOM?
&lt;/h2&gt;

&lt;p&gt;The shadow DOM is a small representation of the DOM (sub tree of the DOM) while the virtual DOM is a representation of the whole DOM. The shadow DOM is a scoped tree and only effects the element that it is connected to and not the children. This makes styling scoped as well which is what a lot of people use the shadow DOM for. It also makes rerenders more performant as it  doesn’t rerender or worry about the whole DOM (parents and children of the element you actually care about) just the element that it is scoped to. &lt;/p&gt;

&lt;p&gt;The main difference being that the shadow DOM is scoped for a particular element while the virtual DOM is for the whole DOM.&lt;/p&gt;

&lt;p&gt;Let me know if there are any other questions you like to ask in your interviews or a question you’ve been asked that you thought was a great question. There are so many possible questions you could be asked but I hope this helps you get started on your interviewing journey!&lt;/p&gt;

</description>
      <category>react</category>
      <category>career</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Best Laptops for Software Development in 2021</title>
      <dc:creator>Hello Dev World Blog</dc:creator>
      <pubDate>Fri, 11 Jun 2021 22:28:47 +0000</pubDate>
      <link>https://dev.to/hellodevworldblog/2021-best-laptops-for-software-development-573p</link>
      <guid>https://dev.to/hellodevworldblog/2021-best-laptops-for-software-development-573p</guid>
      <description>&lt;p&gt;&lt;em&gt;This post contains affiliate links. If you use these links to buy something I may earn a commission. Thanks.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So, I often get asked what the best computer for doing software development is and I kind of hate that question because the answer is it depends. Are you only going to use it for software development? What else do you want to do on it? What operating system do you want? What kind of development are you going to be doing? So ya. It depends and arguably you could do development from just your phone. Nothing special needed. However, I will do my best to make a top 5 list of best laptop choices for software development (in no particular order).&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;a href="https://amzn.to/35d1a3q"&gt;MacBook Pro 13”&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Okay so this is a hot topic but I love using a &lt;a href="https://amzn.to/35d1a3q"&gt;MacBook&lt;/a&gt; for development. I’ve been using them for years and never had issues. It’s also a must-have if you are doing ruby development as you may run into issues with it on a PC. The reason I say a &lt;a href="https://amzn.to/35d1a3q"&gt;13” MacBook Pro&lt;/a&gt; is because the &lt;a href="https://amzn.to/35bOxp5"&gt;16” versions&lt;/a&gt; don’t have the M1 chip yet. It is on its way but not out yet. When that comes out I will be updating this for that instead. You can never have too much real estate when developing especially for web developers. If you are looking to do App development and want to support apple devices an &lt;a href="https://amzn.to/3cBs74K"&gt;iMac&lt;/a&gt; or &lt;a href="https://amzn.to/35d1a3q"&gt;MacBook Pro&lt;/a&gt; will be a must-have as you need them to compile your apps and release them to the store. If you are a game engineer the screens on the &lt;a href="https://amzn.to/35d1a3q"&gt;MacBooks&lt;/a&gt; are incredible and with the new M1 chips you shouldn’t have any issue with processing power although they may run a little hot. I also get the higher RAM and storage because I would rather have more and not need it than need it but not have it.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. &lt;a href="https://amzn.to/35fsUEi"&gt;Razer Blade 15&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;If you are leaning more towards a pc the &lt;a href="https://amzn.to/35fsUEi"&gt;razer blade 15 with a RTX 3070&lt;/a&gt; is a great choice. I love this laptop because is a beast and super portable. I used to have this laptop for traveling because I liked that I could do work and gaming on the laptop. If you want a lot of power in a small laptop this is a great choice. The screen is also amazing. It also has plenty of processing power for the game developers and a great screen for them to work on. If you are doing .NET development (not core but anything other than core) you will want to opt for a PC as you won’t be able to do it on a mac. Again I opt for the higher ram and if possible get more storage. I also opt for &lt;a href="https://amzn.to/35fsUEi"&gt;the 3070&lt;/a&gt; instead of &lt;a href="https://amzn.to/3gdVJYc"&gt;the 3060&lt;/a&gt; because I use it for gaming and would rather have the power than not. The extra power is also a must if you are going to be doing game development or video processing.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. &lt;a href="https://amzn.to/3iyW9dh"&gt;Asus ROG Zephyrus﻿﻿&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;This is actually the current laptop that I have as my travel laptop. It is such a beast of a computer for a great price. It isn’t too heavy and has enough power for gaming as well as web development. If you want the best screen around this isn’t the best choice you get a lot for your money with this laptop. You get a great amount of storage and RAM in a small laptop for around $2000. I have last years’ version and since then they have unfortunately raised the prices I think due to the expense of the new graphics cards but I still think this years’ is a great choice for a great price. They do have a &lt;a href="https://amzn.to/3ivtKoq"&gt;cheaper option with a 3060&lt;/a&gt; instead of a 3070 personally I think it’s worth the extra for the better graphics card but I also play some graphics-intensive games. Again if you are doing .NET development (not core but anything other than core) you will want to opt for a PC as you won’t be able to do it on a mac. &lt;/p&gt;

&lt;h2&gt;
  
  
  4. &lt;a href="https://amzn.to/2RMpupv"&gt;Surface Pro&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;I have always found &lt;a href="https://amzn.to/2RMpupv"&gt;surface pros&lt;/a&gt; really interesting. At this point, they are a great very portable option. However, they are more like tablets which bother some people. They do run the full Windows OS and can definitely handle web development. I wouldn’t choose this if you are a game developer as I don’t think it would have enough processing power. But if you are looking for a lightweight very portable option for development definitely check one of these out! One these I actually opt for the cheaper options because you won’t be using this for much more than web development or basic web browsing and I don’t think it’s worth the extra cost for the &lt;a href="https://amzn.to/3cBc6vy"&gt;upgraded version with more RAM and storage&lt;/a&gt; as the &lt;a href="https://amzn.to/2RMpupv"&gt;lower version&lt;/a&gt; can handle everything you’d be doing on it. Again if you are doing .NET development (not core but anything other than core) you will want to opt for a PC as you won’t be able to do it on a mac although visual studio (the full IDE) does take a good amount of processing power usually so if you will be doing this I would consider the upgraded version of the surface&lt;/p&gt;

&lt;h2&gt;
  
  
  5. &lt;a href="https://amzn.to/3gceQBU"&gt;Dell XPS 15&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;If you are a .Net developer or work in a PC shop you will most likely have used this before or may currently be using it. Say what you will about dell but I never had issues developing on an &lt;a href="https://amzn.to/3gceQBU"&gt;XPS&lt;/a&gt;. They are a super solid option if you are doing web development as they are plenty powerful but don’t have all the bells and whistles that you pay extra for in other computers. I don’t think they are the best option for gaming devs or people who want to also use their laptops for gaming but if you just want to use your computer for development this is a very solid and cheap option.&lt;/p&gt;

&lt;h2&gt;
  
  
  *Bonus &lt;a href="https://amzn.to/3pJm7wf"&gt;MSI Stealth&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;I have always been a huge MSI fan. My first laptop was an MSI and lasted over 5 years. They are a little more pricey but they have great customer service and are built really well. &lt;a href="https://amzn.to/3pJm7wf"&gt;This MSI laptop&lt;/a&gt; will be able to handle anything and everything and is definitely a great investment especially if you are a game developer or would like to play games on this laptop as well. They do have &lt;a href="https://amzn.to/35f4zhT"&gt;cheaper versions&lt;/a&gt; of this laptop with similar specs. But, these are the specs I would go for especially if you are doing any gaming. If you don’t care a lot about refresh rate or playing a lot of processor-heavy games you can definitely go with the &lt;a href="https://amzn.to/35f4zhT"&gt;cheaper version&lt;/a&gt; though and they are still a great choice. &lt;/p&gt;

&lt;p&gt;I hope this helps you when deciding on your next laptop you really can’t go wrong with any of the options just keep in mind the type of development you want to do and what else you may want to do on the laptop.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>career</category>
      <category>help</category>
    </item>
    <item>
      <title>Overcoming Common Agile Software Development Struggles</title>
      <dc:creator>Hello Dev World Blog</dc:creator>
      <pubDate>Mon, 19 Apr 2021 23:15:48 +0000</pubDate>
      <link>https://dev.to/hellodevworldblog/overcoming-common-agile-software-development-struggles-5gjd</link>
      <guid>https://dev.to/hellodevworldblog/overcoming-common-agile-software-development-struggles-5gjd</guid>
      <description>&lt;p&gt;When it comes to software development, “agile” has been a buzzword at every company for the last couple of years. An agile methodology makes a lot of sense in theory, and tons of companies have started to implement it. Basically, agile software development is a software development methodology that relies on collaboration between cross-functional teams and the end-user or customer. &lt;/p&gt;

&lt;p&gt;While the principles of agile are straightforward, implementing them in a way that enables your dev team(s) to rapidly build, scale, and deliver functionality to your clients or customers can be challenging. &lt;/p&gt;

&lt;p&gt;Releasing a new or updated product often can be hard to manage, quick development can become messy and cause bugs, and getting feedback on major features of a new product without that new product being released can be hard. &lt;/p&gt;

&lt;p&gt;So what are some things that can help alleviate some of these issues?&lt;/p&gt;

&lt;p&gt;It comes down to creating an agile software development methodology that works for your software engineering team, your company, and your end-users. So we’ve laid out some quick tips on how to go about creating agile processes that work. &lt;/p&gt;

&lt;h2&gt;
  
  
  CREATE A RELIABLE RELEASE PROCESS
&lt;/h2&gt;

&lt;p&gt;One of the major benefits of agile is the ability to rapidly iterate on an idea and quickly collect feedback from your users. However, if you don’t have a stable release process, you’ll quickly find yourself with a buggy system, unhappy customers, and a burnt-out development team. Yikes!&lt;/p&gt;

&lt;p&gt;Each team will have their own set of nuances and constraints that will shape their release process, but here are 4 things we believe make up any successful agile release process: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Solid branching strategy/workflow&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Automated CI/CD pipelines&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ephemeral environments&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Application monitoring&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  BRANCHING STRATEGY/WORKFLOW
&lt;/h3&gt;

&lt;p&gt;When your team is well-organized and knows how to quickly and safely release their code, the team can be a lot more productive and confident about their releases. Having a proper branching strategy is vital for a team to be sure they know what code is going out, where their code is in the pipeline, and how to properly and safely merge their code into the codebase. A workflow a lot of agile teams use and have found effective is Gitflow by Atlassian.&lt;/p&gt;

&lt;h3&gt;
  
  
  AUTOMATED CI/CD PIPELINES
&lt;/h3&gt;

&lt;p&gt;Adding your automated tests to your pipelines will help ensure that the code that is about to be merged will not break the existing functionality. It will bring ease of mind that the changes will not have unintended consequences and is safe to merge. &lt;/p&gt;

&lt;p&gt;At my current job, we don’t allow code to be merged until it has passed its unit tests and coverage, and then we run automated end-to-end tests later in the pipeline.&lt;/p&gt;

&lt;h3&gt;
  
  
  EPHEMERAL ENVIRONMENTS
&lt;/h3&gt;

&lt;p&gt;Here’s how Ephemeral testing environments work: they are brand new environments that would be spun up every time a new feature is ready to be tested before merging it into the codebase. Once the feature is tested and merged into the code base, the environment would then be spun back down and no longer used. &lt;/p&gt;

&lt;p&gt;These environments allow developers to test their specific feature in what already exists in production without affecting any other developer, being affected by messy data, or affecting any other developers that may be working on another feature.&lt;/p&gt;

&lt;h3&gt;
  
  
  APPLICATION MONITORING
&lt;/h3&gt;

&lt;p&gt;Having monitoring in all your environments not only makes debugging easy and quick but also ensures that if something does go wrong, your developers are notified right away. &lt;/p&gt;

&lt;p&gt;Most monitoring tools have integrations with messaging tools like Slack, that way your developers can not only get an email when something is broken but also a Slack message. We’ve found that when messages are sent through a messaging service, they’re more likely to be seen and handled faster. &lt;/p&gt;

&lt;p&gt;Some additional monitoring tools we use at my current job are Splunk and Sentry—they’ve been invaluable!&lt;/p&gt;

&lt;h2&gt;
  
  
  IMPLEMENT FEATURE FLAGGING
&lt;/h2&gt;

&lt;p&gt;Feature flagging is like a light switch—it allows developers to turn features off and on quickly, and it can even restrict or enable certain features for a particular subset of users. This allows features to get in front of users for testing without having to completely release the feature if the team wants to get feedback before rolling out to everyone. &lt;/p&gt;

&lt;p&gt;Feature flagging also allows features to go out, and if they’re causing issues, they can quickly be turned off. This allows teams to push out features without worrying about breaking what’s already working and allows users to provide quick feedback. &lt;/p&gt;

&lt;p&gt;Consider LaunchDarkly, which is our preferred product for feature flagging, but there are many other products that do this, too.&lt;/p&gt;

&lt;h2&gt;
  
  
  USE IFRAMES AND/OR PACKAGES
&lt;/h2&gt;

&lt;p&gt;You may see this and think I’m crazy, but hear me out! If you’re replacing an old application with a new one, you might want to consider using iframes or packages. Here’s why.&lt;/p&gt;

&lt;p&gt;By breaking out your new application into major features and iframing the new features or making your features into a package that can be brought into the old application, you can start getting pieces of the new application in front of users. The biggest benefit to this approach is that it allows the team to get feedback on features as they’re building (rather than at the end). That’s a huge efficiency! &lt;/p&gt;

&lt;p&gt;Iframing also allows users to get used to the new features, and it allows iterative releases rather than a full application release all at once. &lt;/p&gt;

&lt;p&gt;I hope this helps you on your agile development journey!&lt;/p&gt;

</description>
      <category>agile</category>
      <category>productivity</category>
      <category>architecture</category>
      <category>development</category>
    </item>
    <item>
      <title>MongoDB Aggregation Pipeline Challenge 1 Solution</title>
      <dc:creator>Hello Dev World Blog</dc:creator>
      <pubDate>Sun, 31 Jan 2021 20:31:15 +0000</pubDate>
      <link>https://dev.to/hellodevworldblog/mongodb-aggregation-pipeline-challenge-1-solution-14f8</link>
      <guid>https://dev.to/hellodevworldblog/mongodb-aggregation-pipeline-challenge-1-solution-14f8</guid>
      <description>&lt;p&gt;This is an awesome challenge that my boss Justin sent me and thought it would be a fun one for you all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; there are MANY ways to solve this challenge this is just Justin’s solution to this challenge&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TLDR:&lt;/strong&gt; If all you want to see is the aggregate solution it is in the franchiseeCustomerSatScoreBreakdown function&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Big Ice Cream Co is the largest ice cream franchisor in the US. Each of their 100+ franchisees has between 1 and 25 locations. Each location tracks its customer satisfaction score which can be below average, average, or above average. The CEO of Big Ice Cream Co wants to see a report that shows the customer satisfaction scores for each location grouped by franchisee.&lt;/p&gt;

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

&lt;p&gt;| franchiseeId | franchiseeName | belowAverage | average | aboveAverage | totalLocations |&lt;/p&gt;

&lt;p&gt;|---------------------|---------------:|--------------|---------|--------------|----------------|| &lt;/p&gt;

&lt;p&gt;search | True | 1 | 10 | 14 | 25 || &lt;/p&gt;

&lt;p&gt;institutionCodes | False | 10 | 3 | 0 | 13 || &lt;/p&gt;

&lt;p&gt;aggregatorPartnerId | True | 0 | 3 | 0 | 3 |&lt;/p&gt;

&lt;p&gt;This data is stored in the franchising MongoDB, there are two collections:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;franchisee&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;locations&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Franchisee schema&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;companyName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="nx"&gt;signedDate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="nx"&gt;owner&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Locations schema&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    franchiseeId: { type: ObjectId },
    address: {
        state: { type: String },
        city: { type: String },
        zip: { type: String },
        streetAddress: { type: String },
        secondaryAddress: { type: String }
    },
    customerSatisfactionScore: { type: String, enum : ['below average','average', 'above average'] }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;This solution is in JavaScript but there are many languages you can do this in.&lt;/p&gt;

&lt;p&gt;First, let’s set up the basic file of everything we are going to need. getSatScoreCount and franchiseeCustomerSatScoreBreakdown are going to be helper functions and the customerSatBreakdown is going to be the main function that will set up the database and return the data. If you would like me to do a post on how to set up a JavaScript file like this let me know in the comments I would happy to do so!&lt;/p&gt;

&lt;p&gt;This will set up the mongo client, get the data from the helper functions and create a CSV of the data we needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;promisify&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;util&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Parser&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;json2csv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dotenv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dotenv-extended&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ObjectId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;MongoClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;mongodb&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;writeFileAsync&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;promisify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;writeFile&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getSatScoreCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;scoreName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;franchiseeCustomerSatScoreBreakdown&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;franchisingDb&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;customerSatBreakdown&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// connect to db&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;db_url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DB_URL&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dbClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;MongoClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;db_url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;useUnifiedTopology&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;franchisingDb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;dbClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;franchising&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;franchiseeCustomerSatScoreBreakdown&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;franchisingDb&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fields&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
              &lt;span class="na"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="p"&gt;})&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;json2csvParser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Parser&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;fields&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;csvData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;json2csvParser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// write to JSON file&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;writeFileAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;franchising-customer-sat-scores.csv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;csvData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;dotenv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;load&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.env&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;errorOnMissing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;errorOnExtra&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;


&lt;span class="nx"&gt;customerSatBreakdown&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let’s put together the bread and butter, the aggregate. We are going to do an aggregate on the collection of the location of the database. &lt;/p&gt;

&lt;p&gt;First, we are going to need to lookup. A lookup is a left join in mongo. If you don’t know what that is it takes the data from the left table and what is the same from the right table. Here is an image that may help understand better as well.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sEEE95bY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wsvqpfmjnbpi5qcaypqk.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sEEE95bY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wsvqpfmjnbpi5qcaypqk.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
We are going to be doing this join on the frachisee table to get the franchisee with their location.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;franchiseeCustomerSatScoreBreakdown&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;franchisingDb&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;locationsCollection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;franchisingDb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;locations&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;locationsCollection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;aggregate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt; 
      &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;$lookup&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;franchisee&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;localField&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;franchiseeId&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;foreignField&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;_id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;as&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;franchiseeInfo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We then want to “unwind” the franchiseeInfo. This will destructure the franchisee info object. If we don’t have this when you get the data the franchiseeInfo will look something like this: franchiseeInfo: [ [Object] ]. When we add unwind it will look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;franchiseeInfo&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nl"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;6015&lt;/span&gt;&lt;span class="nx"&gt;a1f19ab3e80b64d50508&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;companyName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Waelchi Inc&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;signedDate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2020&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;29&lt;/span&gt;&lt;span class="nx"&gt;T19&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;26&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;18.097&lt;/span&gt;&lt;span class="nx"&gt;Z&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;owner&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Catherine Kozey&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;our aggregate will now look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;franchiseeCustomerSatScoreBreakdown&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;franchisingDb&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;locationsCollection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;franchisingDb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;locations&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;locationsCollection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;aggregate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt; 
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;$lookup&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;franchisee&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;localField&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;franchiseeId&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;foreignField&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;_id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;as&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;franchiseeInfo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;$unwind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$franchiseeInfo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
      &lt;span class="p"&gt;])&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are going to have 2 groups. The first group is going to be grouping all the locations with their customer satisfaction scores. This grouping will get the name of the franchisee company name, customer satisfaction score, franchisee id, and the count of the locations with that satisfaction score.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;$group&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt; 
            &lt;span class="na"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt; &lt;span class="na"&gt;franchiseeId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$franchiseeId&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;satScore&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$customerSatisfactionScore&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;franchiseeName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$franchiseeInfo.companyName&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; 
            &lt;span class="na"&gt;locationsCount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;$sum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; 
        &lt;span class="p"&gt;}},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The second group is going to group each of the scores with the franchisee along with a total number of locations. This will make it from multiple records broken up for each franchisee to all of the sums of the scores for the franchisees and the total count all in the same record.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;$group&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;franchiseeId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$_id.franchiseeId&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;franchiseeName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$_id.franchiseeName&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;scores&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
                &lt;span class="na"&gt;$push&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
                    &lt;span class="na"&gt;satScore&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$_id.satScore&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$locationsCount&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;$sum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$locationsCount&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we are going to throw that in an array. If you don’t do this your return type will just be an aggregate cursor (cursor to the document) and it won’t make any sense or be the data you want. By adding a toArray() you are pushing all that data into an array that you can actually use.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;franchiseeCustomerSatScoreBreakdown&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;franchisingDb&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;locationsCollection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;franchisingDb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;locations&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;locationsCollection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;aggregate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt; 
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;$lookup&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;franchisee&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;localField&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;franchiseeId&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;foreignField&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;_id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;as&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;franchiseeInfo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;$unwind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$franchiseeInfo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;$group&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt; 
            &lt;span class="na"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt; &lt;span class="na"&gt;franchiseeId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$franchiseeId&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;satScore&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$customerSatisfactionScore&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;franchiseeName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$franchiseeInfo.companyName&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; 
            &lt;span class="na"&gt;locationsCount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;$sum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; 
        &lt;span class="p"&gt;}},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;$group&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;franchiseeId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$_id.franchiseeId&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;franchiseeName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$_id.franchiseeName&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;scores&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
                &lt;span class="na"&gt;$push&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
                    &lt;span class="na"&gt;satScore&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$_id.satScore&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$locationsCount&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;$sum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$locationsCount&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}}&lt;/span&gt;
    &lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="nx"&gt;toArray&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The rest of this is going to be how we are making the data able to be returned in aa csv with JavaScript. &lt;/p&gt;

&lt;p&gt;Before we are going to return the data we want to get the scores from the scores group destructured. For this we are going to map over data get structure it how we want for the csv. For this we are going to use a helper function to pull the score out for each type of score.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getSatScoreCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;scoreName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;targetIndex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;scores&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;findIndex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;satScore&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;scoreName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;targetIndex&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;scores&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;targetIndex&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this is what our map is going to looks like as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;franchiseeId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;franchiseeId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;franchiseeName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;franchiseeName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;belowAverage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;getSatScoreCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;below average&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="na"&gt;average&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;getSatScoreCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;average&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="na"&gt;aboveAverage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;getSatScoreCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;above average&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="na"&gt;totalLocations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and thats it! this will be the full file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;promisify&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;util&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Parser&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;json2csv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dotenv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dotenv-extended&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;ObjectId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;MongoClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;mongodb&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;writeFileAsync&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;promisify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;writeFile&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getSatScoreCount&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;scoreName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;targetIndex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;scores&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;findIndex&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;s&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;satScore&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;scoreName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;targetIndex&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;scores&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;targetIndex&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;franchiseeCustomerSatScoreBreakdown&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;franchisingDb&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;locationsCollection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;franchisingDb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;locations&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;locationsCollection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;aggregate&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt; 
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;$lookup&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
              &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;franchisee&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;localField&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;franchiseeId&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;foreignField&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;_id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="na"&gt;as&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;franchiseeInfo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
              &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;$unwind&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$franchiseeInfo&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;$group&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt; 
            &lt;span class="na"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt; &lt;span class="na"&gt;franchiseeId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$franchiseeId&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;satScore&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$customerSatisfactionScore&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;franchiseeName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$franchiseeInfo.companyName&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; 
            &lt;span class="na"&gt;locationsCount&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;$sum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; 
        &lt;span class="p"&gt;}},&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;$group&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;franchiseeId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$_id.franchiseeId&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;franchiseeName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;$_id.franchiseeName&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;scores&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
                &lt;span class="na"&gt;$push&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
                    &lt;span class="na"&gt;satScore&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$_id.satScore&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$locationsCount&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
                &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;$sum&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$locationsCount&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}}&lt;/span&gt;
    &lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="nx"&gt;toArray&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;franchiseeId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;franchiseeId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;franchiseeName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_id&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;franchiseeName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;belowAverage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;getSatScoreCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;below average&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="na"&gt;average&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;getSatScoreCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;average&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="na"&gt;aboveAverage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;getSatScoreCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;above average&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="na"&gt;totalLocations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;customerSatBreakdown&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// connect to db&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;db_url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;DB_URL&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dbClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;MongoClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;db_url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;useUnifiedTopology&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;franchisingDb&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;dbClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;franchising&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;franchiseeCustomerSatScoreBreakdown&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;franchisingDb&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fields&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;keys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]).&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
              &lt;span class="na"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
              &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="p"&gt;})&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;json2csvParser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Parser&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;fields&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;csvData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;json2csvParser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="c1"&gt;// write to JSON file&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;writeFileAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;franchising-customer-sat-scores.csv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;csvData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;dotenv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;load&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;silent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.env&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;errorOnMissing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;errorOnExtra&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="nx"&gt;customerSatBreakdown&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope you all enjoyed this one! If there was something that you would like a more in-depth article about or something you need more explanation on please let me know in the comments below! If you would like to get an email when new articles are released sign up for &lt;a href="https://lp.constantcontactpages.com/su/N3rQysX/Newsletter"&gt;the newsletter here&lt;/a&gt;! :)&lt;/p&gt;

</description>
      <category>challenge</category>
      <category>mongodb</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What Not to Do as a Junior Developer</title>
      <dc:creator>Hello Dev World Blog</dc:creator>
      <pubDate>Sat, 30 Jan 2021 17:47:52 +0000</pubDate>
      <link>https://dev.to/hellodevworldblog/what-not-to-do-as-a-junior-developer-941</link>
      <guid>https://dev.to/hellodevworldblog/what-not-to-do-as-a-junior-developer-941</guid>
      <description>&lt;p&gt;Congrats! You have chosen the best and most overwhelming career. There are so many great things about being a developer or software engineer but do not fall into these pitfalls junior engineers frequently fall into!&lt;/p&gt;

&lt;h1&gt;
  
  
  1. Be a Smart Ass
&lt;/h1&gt;

&lt;p&gt;You may think this is a given but you would be surprised how many junior developers have an attitude and that they know better than everyone. Let me tell you no matter how much faster you could do your work than the others in your class you do not know more than your senior developer and you have no reason to be cocky. No one likes helping someone with a bad attitude and trust me you will need help. You will quickly learn you really don’t know much at all and your senior developers can teach you SO much if you let them. So leave your ego at home.  &lt;/p&gt;

&lt;h1&gt;
  
  
  2. Stay Quiet
&lt;/h1&gt;

&lt;p&gt;Ask questions! As a junior developer people do not expect you to know everything and that is okay! However, they don’t know what you don’t unless you ask them! You also may ask questions that make the team think about how they have implemented something in a different way or bring up something they have never thought of. A fresh pair of eyes is always a good thing. &lt;/p&gt;

&lt;p&gt;You are also allowed to have an opinion. Feel free to voice it with an open mind. Your higher-level developers may not know some technology that you are aware of, or they may have a reason they are doing what they are instead and they will explain to you why that is the better option for that situation. &lt;/p&gt;

&lt;h1&gt;
  
  
  3. Try to Learn a Bunch of Languages
&lt;/h1&gt;

&lt;p&gt;Becoming a software engineer or developer can be super exciting but also daunting at the same time. There are SO many languages to learn and all kinds of fun stuff you can do. Half of what your senior is talking about you won’t understand but you’ll want to! Just slow down a second! Learning the foundations of development and of the specific stack you are working in is SO important. You will find yourself getting much further in your career by focusing on principals and a couple of languages than trying to learn all the languages and stacks. It is so important to understand the nuances of the stack you are in. Take your time to understand development principals and the stack your job is requiring you to understand before moving on from there. Principals and a lot of the base knowledge will transfer to other languages. You will find picking up languages is much easier when you understand the principles and designs behind software development.&lt;/p&gt;

&lt;p&gt;Also start thinking about what kind of development you want to do and focus on that area. Do not try to be an app developer, a web developer, a machine learning developer, and a game developer all at once. They are all SO different. It is okay to dabble to really try and understand what may interest you long term but once you know what path you want to take focus on one thing at a time. It will help you more in the long run.&lt;/p&gt;

&lt;h1&gt;
  
  
  4. Focus on Frameworks
&lt;/h1&gt;

&lt;p&gt;I see SO many juniors trying to learn a bunch of different frameworks and skip the basics because why would you use the basics of the framework does it for you?! Well, there are a lot of reasons.&lt;/p&gt;

&lt;p&gt;The main reason is to understand what the framework is doing. Reading docs for frameworks and APIs will be a struggle if you don’t understand what they are doing under the hood. Frameworks aren’t always the best way to go either. You need to understand what the framework is doing so that you can make an educated decision on which to use or if you should use it at all.&lt;/p&gt;

&lt;p&gt;Frameworks are always changing but the underlying languages don’t change as much. React, Vue, and Angular are all very different but at the end of the day, they are all JavaScript. Understanding how JavaScript as a base language works will help you better understand how the frameworks function and how what they are doing affects state, performance, and other functions within your application. You will be able to catch issues before you even run into them that you wouldn’t if you didn’t understand the underlying language.&lt;/p&gt;

&lt;p&gt;Debugging can also be a struggle. In Javascript for instance you could be implementing an async-await call and try to log out the response and get. [Promise] or you may be erroring with “unresolved promise” and you are like what’s a promise?! Then struggle on how to fix your issue or how to see what you actually wanted.  In case you don’t know in JavaScript async-await is really a wrapper around promises. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Extra:&lt;/strong&gt; Performance isn't something junior developers should worry about too much but it is important. It also happens to not always the best with frameworks either. For instance in JavaScript to flatten an array you can use .flat() but it is horribly inefficient. If you know more of the basic language you can easily write a performant loop to do the same thing. But also understanding the difference is something you should take the time to learn.&lt;/p&gt;

&lt;h1&gt;
  
  
  5. Burn Yourself Out
&lt;/h1&gt;

&lt;p&gt;There is so much to learn and so much to do that you may feel overwhelmed. It may make you obsess over what you don’t know and everything you need to learn. This is a very deep rabbit hole that will never end. Try not to obsess over it! You will quickly burn yourself out and trust me you will need the energy and passion throughout your career. You have chosen a unique career that moves faster than any other career and that you will need to continuously learn how to do your whole career. Try not to burn out so that you can be the best developer you can be for more than a few years.  It may not seem like you are burning yourself out but you will all of a sudden hit a wall and it will suck. Seriously take time off and don’t overwork yourself. You will thank yourself later!&lt;/p&gt;

&lt;p&gt;I hoped this helped and I hope you love being a software engineer as much as I do. It’s an amazing unique career but can also be a lot! Take your time! Enjoy your time as a Junior Developer to learn and stoke your passion for it before people actually expect things from you ;p&lt;/p&gt;

&lt;p&gt;If you want to be notified when new content comes up sign up for &lt;a href="https://lp.constantcontactpages.com/su/N3rQysX/Newsletter"&gt;the newsletter&lt;/a&gt;! :)&lt;/p&gt;

</description>
      <category>career</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>MongoDB Aggregation Pipeline Challenge - Challenge 21</title>
      <dc:creator>Hello Dev World Blog</dc:creator>
      <pubDate>Fri, 29 Jan 2021 23:55:42 +0000</pubDate>
      <link>https://dev.to/hellodevworldblog/mongodb-aggregation-pipeline-challenge-challenge-21-4no7</link>
      <guid>https://dev.to/hellodevworldblog/mongodb-aggregation-pipeline-challenge-challenge-21-4no7</guid>
      <description>&lt;p&gt;Another Challenge!&lt;/p&gt;

&lt;p&gt;Big Ice Cream Co is the largest ice cream franchisor in the US. Each of their 100+ franchisees has between 1 and 25 locations. Each location tracks its customer satisfaction score which can be below average, average, or above average. The CEO of Big Ice Cream Co wants to see a report that shows the customer satisfaction scores for each location grouped by franchisee.&lt;/p&gt;

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

&lt;p&gt;| franchiseeId | franchiseeName | belowAverage | average | aboveAverage | totalLocations |&lt;/p&gt;

&lt;p&gt;|---------------------|---------------:|--------------|---------|--------------|----------------|| &lt;/p&gt;

&lt;p&gt;search | True | 1 | 10 | 14 | 25 || &lt;/p&gt;

&lt;p&gt;institutionCodes | False | 10 | 3 | 0 | 13 || &lt;/p&gt;

&lt;p&gt;aggregatorPartnerId | True | 0 | 3 | 0 | 3 |&lt;/p&gt;

&lt;p&gt;This data is stored in the franchising MongoDB, there are two collections:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;franchisee&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;locations&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Franchisee schema&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    companyName: { type: String },
    signedDate: { type: Date },
    owner: { type: String }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Locations Schema&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    franchiseeId: { type: ObjectId },
    address: {
        state: { type: String },
        city: { type: String },
        zip: { type: String },
        streetAddress: { type: String },
        secondaryAddress: { type: String }
    },
    customerSatisfactionScore: { type: String, enum : ['below average','average', 'above average'] }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As usual, I will be posting the solution in another post! I will post this solution with an explanation tomorrow!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>mongodb</category>
      <category>challenge</category>
      <category>365daysofcoding</category>
    </item>
  </channel>
</rss>
