<?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: Shahar Avigezer</title>
    <description>The latest articles on DEV Community by Shahar Avigezer (@shahar_avigezer).</description>
    <link>https://dev.to/shahar_avigezer</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F737958%2F5972e7bf-0280-4852-a82f-46eebdaae8ad.png</url>
      <title>DEV Community: Shahar Avigezer</title>
      <link>https://dev.to/shahar_avigezer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shahar_avigezer"/>
    <language>en</language>
    <item>
      <title>5 Takeaways From My Career as a Software Developer</title>
      <dc:creator>Shahar Avigezer</dc:creator>
      <pubDate>Wed, 27 Oct 2021 08:52:02 +0000</pubDate>
      <link>https://dev.to/shahar_avigezer/5-takeaways-from-my-first-job-as-a-software-developer-3lbm</link>
      <guid>https://dev.to/shahar_avigezer/5-takeaways-from-my-first-job-as-a-software-developer-3lbm</guid>
      <description>&lt;p&gt;I’m closing in on 5 years in my career as a full stack developer at a startup and OH BOY, what a ride it has been. I’ve learned so much during this year, here are some of my conclusions from my experience so far.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1 - Reading and understanding others’ code is one of the most valuable skills you can develop&lt;/strong&gt;.&lt;br&gt;
90% of my first challenges were integrating into an existing code base so most of my day included reading and debugging to figure out how things work. I dedicated time to learn and unravel the relevant code base in order to spot the exact place to seamlessly blend in and add my own code or refactor existing code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/fv8KclrYGp5dK/source.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/fv8KclrYGp5dK/source.gif" alt="" width="458" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2 - Using visual thinking techniques helps solve the problem faster&lt;/strong&gt;.&lt;br&gt;
I would sketch the model I was working on, the flow of the algorithm I was building or the layers of communication between the client and the server. These scribbles really assisted me in rearranging my thoughts and when I had it all laid out before me, the coding part would flow and I knew exactly what I need to do in every step.&lt;/p&gt;

&lt;blockquote&gt;
&lt;h2&gt;
  
  
  First solve the problem, than write the code
&lt;/h2&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;3 - Reaching out to other developers is a great brainstorming opportunity.&lt;/strong&gt;&lt;br&gt;
It allowed me to get a set of fresh eyes on the solution, hear different approaches to the problem. Also, by recapping the issue at hand, I became more and more focused on the right solution. Actually, a couple of my developer friends and I have a regular coffee meet up in which we share and brainstorm all about our challenges at work and we learn a lot from it overtime.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4 - Learning about other parts of the company can upgrade your professional status.&lt;/strong&gt;&lt;br&gt;
The more I got to know how my work relates to other departments in the company, the more relevant ideas I came up with. When I worked on a piece of code, I knew exactly how it merges into the overall picture and I was able to think ahead about efficient solutions and out of the box edge cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5 - Acknowledging your limits and finding the things that refill your energy is critical to avoid burning out&lt;/strong&gt;.&lt;br&gt;
The tech industry is a stressful and demanding environment and it’s easy to get sucked into it because work is never ending. As the year progressed, I’ve noticed what inspires me with motivation, and what helps me recharge. I’ve made a point to integrate these things into my day-to-day life. Whether it’s going to a good music concert, hanging out at the beach or just binge watching a good TV show — I found the time to do it. Being productive in the long term is important also to my employer, as it should be, so I learned how to raise a flag whenever I felt I needed a break.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/FqdruC6cJYXxC/source.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/FqdruC6cJYXxC/source.gif" alt="" width="312" height="176"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/@shahar_avigezer"&gt;Follow me on Medium&lt;/a&gt; to learn more about how to break into the tech industry and how to improve your software development skills:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://startupsventurecapital.com/12-steps-to-land-a-junior-developer-job-5cbdd081a8b.gif"&gt;12 Steps to Land a Junior Developer Job&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://medium.com/digital-vault/10-ways-to-boost-your-linkedin-profile-to-get-hired-358156db5d8c"&gt;10 Ways to Boost Your LinkedIn Profile To Get Hired&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>career</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Query like A Pro — MongoDB Toolbox</title>
      <dc:creator>Shahar Avigezer</dc:creator>
      <pubDate>Wed, 27 Oct 2021 08:40:24 +0000</pubDate>
      <link>https://dev.to/shahar_avigezer/query-like-a-pro-mongodb-toolbox-52ca</link>
      <guid>https://dev.to/shahar_avigezer/query-like-a-pro-mongodb-toolbox-52ca</guid>
      <description>&lt;p&gt;Ever searched for a Mongo command and got a headache from all of those huge infinite tables? Here’s a simple guide with examples to get you talking to your Mongo shell smoothly&lt;/p&gt;

&lt;h2&gt;
  
  
  What is &lt;a href="https://www.mongodb.com/"&gt;MongoDB&lt;/a&gt;?
&lt;/h2&gt;

&lt;p&gt;MongoDB is a document database with the scalability and flexibility that you want along with the querying and indexing that you need.&lt;/p&gt;

&lt;p&gt;Some &lt;strong&gt;MongoDB strengths&lt;/strong&gt; you should know going in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Stores data in flexible, JSON-like documents by a &lt;strong&gt;dynamic schema&lt;/strong&gt; so the data structure can vary from from document to document in the same collection.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Holds a wide set of intuitive ad hoc queries helps to &lt;strong&gt;access and analyse&lt;/strong&gt; the data easily and efficient indexing and real time aggregation.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Provides a document model that can be easily &lt;strong&gt;maps to objects&lt;/strong&gt; in the application code.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Terminology
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Database/dbs&lt;/strong&gt;— A container that holds a group of collections. Notice that a single MongoDB server can have multiple databases for different purposes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Collections&lt;/strong&gt; — A group of documents which we later query. in SQL terms, the equivalent of a table.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Document/Object&lt;/strong&gt; — A set of key-value pairs based in a dynamic schema which means that one document can have different set of key-value pairs than the other. in SQL terms, the equivalent of a single row in a table.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get started
&lt;/h2&gt;

&lt;h3&gt;
  
  
  MongoDB Installation
&lt;/h3&gt;

&lt;p&gt;You can install &lt;a href="https://docs.mongodb.com/manual/installation/"&gt;manually&lt;/a&gt;, I recommend to use &lt;a href="https://brew.sh/"&gt;Homebrew&lt;/a&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install mongodb
brew services start mongodb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Mongo CLI Launch
&lt;/h3&gt;

&lt;p&gt;The mongo shell is an interactive javascript shell so you need to have a basic knowledge in javascript to get started.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mongo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We can use the default db or connect to our own &lt;strong&gt;new db&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use mymongodb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Operations &amp;amp; Queries
&lt;/h2&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Language basics&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;A query will be structured by calling the db we are currently using, following up with the collection name, for example users and an operator like find() to read data from collection. Also, we can have functions to preform on our query result, for example count().&lt;/p&gt;

&lt;p&gt;So, to retrieve the amount of objects in our &lt;em&gt;users&lt;/em&gt; collection we can use:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.find().count() 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Add Data
&lt;/h3&gt;

&lt;p&gt;As previously mentioned, what’s cool about Mongo is the dynamic style so if the collection does not exist, it will be created! Be careful by using the correct collection names to avoid duplicated.&lt;/p&gt;

&lt;p&gt;To create a single objects in a collection we can use:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.save({
"name" : "jenny",
"title" : "developer",
"company" : "google",
"age" : 24,
"address" : {
   "street" : "73 Pacific St.",
   "area" : "Forest Hills",
   "city" : "New York"
}
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Also, the operator insert can be useful here but I personally feel save is more useful since it can also preforms an update if there is a objects’ _id key that already exist in the collection. For inserting multiple objects, use insertMany([])by passing an array of objects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Read Data
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;The better you know how to find, the less time you waste searching.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let’s start easy, say we want to find our user “charlotte”:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.find({ "name" : "charlotte" })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Use &lt;strong&gt;And / Or&lt;/strong&gt; by passing an array of expressions to match so we can find designers that are also named “dan”.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.find({ $and: [
{ "name" : "dan" },
{ "title" : "designer" }
]})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;As we already established, we might have different set of key-value in our objects so let’s use exists to find only the users who have children:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.find({ "children" : { $exists : true } })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;On certain values like numbers, we can use comparative operators such as grater than (gt) or less than (lt) ect. Let’s get all users who are exactly or above 18 years.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.find({ "age" : { $gte : 18 } })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Say we have a list of names of users we want to extract, you think we’re gonna find find find ?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hell no!&lt;/strong&gt; just use the super-powers of in operator:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var names = [ "michael", "jane", "abram", "justin", "diana" ]

db.users.find({ "name" : { $in : names } })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Let’s find all users who have a more than one position in their title so we can use &lt;strong&gt;regex&lt;/strong&gt; to track down the titles than contains “and”:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.find({ "title" : /and/ })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You’re not sure if it’s &lt;strong&gt;Capitalised&lt;/strong&gt;? add /i to the end of the regex like so:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.find({ "title" : /and/i })
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Modify Data
&lt;/h3&gt;

&lt;p&gt;When we want to modify a property in an existing object, we pass the update() function 2 parameters: a key-value pair to match and a key-value pair to update.&lt;/p&gt;

&lt;p&gt;Let’s make a user younger by changing his age:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.update(
{ "name" : "erik" },
{ $set : { "age" : 24 }
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Must-know tip&lt;/strong&gt; — Always use set otherwise you will change the whole object completely. Don’t fall for this one like I did!&lt;/p&gt;

&lt;p&gt;We can also remove a property from an existing object by using unset, mind that the value is irrelevant since we’re removing the key-value altogether.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.update(
{ "name" : "erik" },
{ $unset : {"age" : 0 }
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In case we want to change multiple objects, we will use multi as a third optional parameter to the function. Let’s transition all our developers to be dancers!&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.update(
{ "title" : "developer" },
{ $set : { "title" : "dancer" } },
{ multi : true }
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;I heard Hawaii is great this time of year so let’s get all our analysts to relocate! When we want modify a nested object we can use . (dot annotation) like so:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.update(
{ "title" : "analyst" },
{ $set : { "address.city" : "Hawaii" }
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Iterate Over Data
&lt;/h3&gt;

&lt;p&gt;Most of the times we would want to go over big chunks of the data so what I found most effective is to convert our result to an iterable array:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var ctos = db.users.find({ "title" : "cto" }).toArray()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;And iterate with any of javascript for loops:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ctos.forEach(function(cto) {
  print(cto.name + " is a CTO at " + cto.company)
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Pro tips&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;By simply calling pretty() after your find() you can turn this view — &amp;gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.find({ "name" : "jenny" })

{ "_id" : ObjectId("5ad34965b299eab765394481"), "name" : "jenny", "title" : "developer", "company" : "google", "age" : 24, "address" : { "street" : "73 Pacific St.", "area" : "Forest Hills", "city" : "New York" } }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;into the easy-on-the-eyes view:&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;db.users.find({ "name" : "jenny" })&lt;strong&gt;.pretty()&lt;/strong&gt;

&lt;p&gt;{&lt;br&gt;
 "_id" : ObjectId("5ad34965b299eab765394481"),&lt;br&gt;
 "name" : "jenny",&lt;br&gt;
 "title" : "developer",&lt;br&gt;
 "company" : "google",&lt;br&gt;
 "age" : 24,&lt;br&gt;
 "address" : {&lt;br&gt;
  "street" : "73 Pacific St.",&lt;br&gt;
  "area" : "Forest Hills",&lt;br&gt;
  "city" : "New York"&lt;br&gt;
 }&lt;br&gt;
}&lt;br&gt;
&lt;/p&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Hope this guide was useful, feel free to share!&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://medium.com/@shahar_avigezer"&gt;Follow me on Medium&lt;/a&gt; to learn how to improve your software development skills, or &lt;a href="https://www.linkedin.com/in/shaharavigezer/"&gt;Connect with me on Linkedin&lt;/a&gt; and let me know if this guide helped you in any way, I’m always excited to hear your stories :)&lt;/p&gt;

&lt;h3&gt;
  
  
  Read more:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://goo.gl/gczMpK"&gt;5 Takeaways From My First Job as a Software Developer&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://goo.gl/BsqNc9"&gt;12 Steps to Land a Junior Developer Job&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://goo.gl/oscDz1"&gt;10 Ways to Boost Your LinkedIn Profile To Get Hired&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>mongodb</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
