<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tyler Cosgrove on Medium]]></title>
        <description><![CDATA[Stories by Tyler Cosgrove on Medium]]></description>
        <link>https://medium.com/@cosgrove.tyler?source=rss-defc8c016458------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*eVrSyPhCMLWQhUJzN7bMDQ.jpeg</url>
            <title>Stories by Tyler Cosgrove on Medium</title>
            <link>https://medium.com/@cosgrove.tyler?source=rss-defc8c016458------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 09:42:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cosgrove.tyler/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[My Fear of Millennial Entrepreneurs]]></title>
            <link>https://medium.com/@cosgrove.tyler/my-fear-of-millennial-entrepreneurs-4a750dd9e75a?source=rss-defc8c016458------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a750dd9e75a</guid>
            <category><![CDATA[millennials]]></category>
            <category><![CDATA[lifestyle]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <dc:creator><![CDATA[Tyler Cosgrove]]></dc:creator>
            <pubDate>Fri, 02 Dec 2016 03:48:58 GMT</pubDate>
            <atom:updated>2016-12-02T14:04:52.711Z</atom:updated>
            <content:encoded><![CDATA[<h4>And I am one</h4><p>Most likely you have a stereotypical image of a millennial sitting in a coffee, shop sipping at a vanilla latte behind the screen of a MacBook plastered with stickers while responding to text messages from his buddies, undoubtedly in coffee shops elsewhere. And for the most part, you’re not wrong. We built this stereotype ourselves, taking pride in what you all consider “idleness” or even “laziness.” “Get a job” or “get a real degree,” you think to yourself. Normally I would agree with you; that is if I weren’t filled with the passion of what it is I really do: work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YZS0j6jAaPTDZYCUIshwJA.jpeg" /><figcaption>Most assuredly not me</figcaption></figure><p>“How can sitting in a coffee shop be work!?” you ask. Allow me to create a distinction; a distinction between the millennial to my left and myself. From the outside, we could look exactly the same. Both of us have a drink in a mug (I prefer hot chocolate myself), a MacBook, headphones in, and a phone on the table. But at our cores, we are vastly opposite.</p><p>You see, the millennial to my left fulfills your stereotype to the letter whereas I, on the other hand, fear the stereotype. With my earbuds pounding the sounds of my favorite Spotify playlist, I program. I work on my first startup with an earnest such as a mother protects her child. It seems so simple to join the millennial to my left in “idleness”, yet my stubborn nature refuses. I have a business to run. I firmly believe that most startups require a team fully dedicated to the mission in order to see the light of day. If I allow myself to slip into idleness for just one moment I will have fulfilled my stereotype. I use my fear of the millennial to the left to drive me forward in my endeavors ensuring that my startup keeps pace. This is my work.</p><p>While I may not be proud of the fact that I foresee this startup taking longer than anticipated to come to fruition I am proud to know that I have a plan. While I continue to bootstrap the business, I have been bootstrapping myself, preparing for programming interviews, building my network, building my skill set all so that I may further land myself a job in web development. I do this all while working as a lifeguard to provide a source of income. For this is who I am; the millennial with a fear of fulfilling stereotypes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a750dd9e75a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Preventing Duplicates in your Meteor.js Collections]]></title>
            <link>https://medium.com/@cosgrove.tyler/preventing-duplicates-in-your-meteor-js-collections-195e7b91f5a9?source=rss-defc8c016458------2</link>
            <guid isPermaLink="false">https://medium.com/p/195e7b91f5a9</guid>
            <category><![CDATA[meteor]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Tyler Cosgrove]]></dc:creator>
            <pubDate>Sat, 09 Apr 2016 20:06:41 GMT</pubDate>
            <atom:updated>2017-08-16T17:08:54.300Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using “update” to effectively keep collections clean and free from repeat data</h4><p>I have frequently come across the problem of how to prevent yourself from inserting duplicates in a Meteor/MongoDB collection, for example, using a collection for configuration. Regardless of your purpose for preventing duplicates, the following is one method that I have found particularly useful.</p><p>The example that will be used will be a collection that contains various authors that a editor wants to keep. The following allows the editor to create a <strong>default</strong> group of editors every time the database is reset (this works great in packages creating a <strong>default or example</strong> data for the developer).</p><pre><em>// File Location `server/authors.js`</em></pre><pre><em>// To begin, we&#39;ll simply create a new `Authors` collection, either<br>// creating or grabbing the current MongoDB database</em><br>Authors = new Meteor.Collection(‘authors’);</pre><pre>// Now we&#39;ll define the default set of authors<br>const authors = [<br>    {<br>        name: &quot;John Smith&quot;,<br>        gender: &quot;Male&quot;,<br>        birthday: &quot;01/25/1984&quot;,<br>        topics: [&#39;SciFi&#39;,&#39;Mystery&#39;]<br>    },<br>    {<br>        name: &#39;Jillian Mathews&#39;,<br>        gender: &quot;Female&quot;,<br>        birthday: &quot;02/03/1992&quot;,<br>        topics: [&#39;Romance&#39;,&#39;Historical Fiction&#39;]<br>    },<br>    {<br>        name: &#39;Tyler Cosgrove&#39;,<br>        gender: &#39;Male&#39;,<br>        birthday: &quot;06/09/NOPE&quot;,<br>        topics: [&#39;Programming Languages&#39;, &#39;Web Development&#39;]<br>    }<br>];</pre><pre>// This is the nitty gritty part<br>// Here you&#39;ll need to use the underscore package (or create<br>// your own for loop to iterate through the author array)</pre><pre>_.each(authors, function(author) {<br>    Authors.update({name: author.name}, {$set: author}, {upsert: true});<br>});</pre><p>Let’s break down that last part, as you should have some familiarity with creating arrays of objects as well as creating collections in Meteor.</p><p>Looking at</p><pre>_.each(authors, function(author) {...}</pre><p>you would hopefully recognize that this is a function provided by underscore.js. For those of you not familiar with this however, it is actually quite simple. <strong>_.each </strong>takes two arguments, the first being the array (or object) that you wish to iterate over. The second being a function containing what you want to do to each portion of the array. The function takes in an argument that each passes to it (in this case an author).</p><p>The inside of the function however is what we’ve come to look for.</p><pre>Authors.update({name: author.name}, {$set: author}, {upsert: true});</pre><p>That is a mouthful. Let’s break it down.</p><pre>Authors.update(...);</pre><p>This simply calls the update function from out Authors collection. Documentation on the update function can be found on the <strong>MongoDB website</strong></p><pre>{name: author.name}</pre><p>This first argument is telling the function to search for a document (database entry) with a field name of the author’s name (so, for example on the first iteration ‘John Smith’</p><pre>{$set: author}</pre><p>The second argument tells the function to set the document to the value of author (which in this case is an object).</p><pre>{upsert: true}</pre><p>Lastly, the third argument, where all the magic takes place. By setting <strong>upsert</strong> equal to <strong>true</strong>, this argument tells the function to create a new document, if a document cannot be found matching the search (as set in the first argument). Otherwise, if an entry is found, it updates the entry.</p><p>Quick disclaimer: I would not recommend using this in a production environment. This is purely to ensure that your development environment is how you need it. In production databases “spin-ups” should be managed by hand.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=195e7b91f5a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>