John Lynn

John Lynn

/mrjohnlynn

John Lynn

Author, educator, lifelong learner, and enthusiast of all things related to data storage and management technologies!

User Avatar

John Lynn

5mo ago

AI Already Saved Your Job
John Lynn

AI already saved your job. You just missed it.

Every task AI handles is one less reason your company needs a junior hire instead of you.

Mid-career professionals now produce what used to take three people. The threat narrative keeps you scared while the shift moves in your favor.

Companies aren't replacing experienced people.

They're eliminating the pipeline that used to make you obsolete.

The person with 15 years of context just got exponentially more valuable.

User Avatar

John Lynn

10mo ago

Merging arrays in MongoDB aggregations just got easier
John Lynn

Suppose that you're working on an e-commerce platform where products have multiple tags, and you need to generate a report showing all tags used within each product category. You want a single flat array per category—not nested arrays, not duplicates necessarily removed, but a straightforward merge of all tag arrays.

This is a common pattern, and until MongoDB 8.1, it required a workaround. Let's look at the old approach, then the cleaner solution now available.

The scenario

Here's our sample data:

db.products.insertMany([
  { name: "Running Shoes", category: "footwear", tags: ["athletic", "lightweight", "breathable"] },
  { name: "Hiking Boots", category: "footwear", tags: ["outdoor", "waterproof", "durable"] },
  { name: "Sandals", category: "footwear", tags: ["casual", "summer"] },
  { name: "Winter Jacket", category: "outerwear", tags: ["warm", "waterproof", "insulated"] }
])

We want all tags for each category combined into one array.

Before MongoDB 8.1

The standard approach used $push to collect arrays, then $reduce to flatten them. Like so:

db.products.aggregate([
  {
    $group: {
      _id: "$category",
      collectedTags: { $push: "$tags" }
    }
  },
  {
    $project: {
      allTags: {
        $reduce: {
          input: "$collectedTags",
          initialValue: [],
          in: { $concatArrays: ["$$value", "$$this"] }
        }
      }
    }
  }
])

The result after the first stage would be an array of arrays:

{ _id: "footwear", collectedTags: [["athletic", "lightweight", "breathable"], ["outdoor", "waterproof", "durable"], ["casual", "summer"]] }

Then the $reduce flattens it. This works, but the two-stage dance for something conceptually straightforward doesn't feel right.

MongoDB 8.1: $concatArrays as an accumulator

Enter the new capability. In MongoDB 8.1, $concatArrays works directly as an accumulator in $group. The query now looks like this:

db.products.aggregate([
  {
    $group: {
      _id: "$category",
      allTags: { $concatArrays: "$tags" }
    }
  }
])

The result:

{ _id: "footwear", allTags: ["athletic", "lightweight", "breathable", "outdoor", "waterproof", "durable", "casual", "summer"] }
{ _id: "outerwear", allTags: ["warm", "waterproof", "insulated"] }

Notice that the three footwear tag arrays merge directly into one flat array. One stage, clear intent.

Where you can use it

The $concatArrays accumulator works in:

  • $group

  • $bucket

  • $bucketAuto

A note on duplicates

What this does is concatenate—it doesn't deduplicate. In our result, if two products had the same tag, it would appear twice. If you need unique values, you'd still use $addToSet instead—though $addToSet with arrays has its own behavior (it treats each array as a single value).

For true deduplication of merged arrays, you might follow $concatArrays with a $setUnion in a $project stage. But for many use cases—like our tag report—duplicates are acceptable or even informative.

So there you have it—cleaner array merging in MongoDB 8.1 aggregations!

User Avatar

John Lynn

1y ago

5 fears holding you back from data science success
John Lynn

Are you letting fear keep you on the sidelines of the data science revolution?

I see it everywhere: brilliant professionals who know they need to upskill in data science and AI, but they’re paralyzed by fear. Fear that they’re not “math-smart” enough. Fear that they’ll embarrass themselves in front of colleagues. Fear that they’re too late to the game. Fear that the technology is moving too fast to catch up. Fear that they’ll waste months learning the wrong things.

Here’s what happens when these fears go unchecked: you watch from the sidelines as others get promoted, land higher-paying roles, and become indispensable to their organizations. Meanwhile, you stay stuck in your current position, knowing you could be doing more but feeling powerless to bridge the gap.

Today, I’m going to help you identify and conquer the 5 biggest fears that keep people from succeeding in data science—so you can finally make the leap.

Let’s walk through each one.

Fear 1: You believe you need a PhD in mathematics to understand data science.

This is the biggest myth in the industry, and it’s keeping thousands of capable people from getting started.

But most successful data scientists use the same basic statistical concepts over and over again: means, medians, correlations, and simple regression models. You don’t need to understand advanced calculus or prove mathematical theorems. You need to understand patterns in data and how to communicate those patterns to business stakeholders.

Here’s what you actually need to know:

• High school algebra (which you already learned)

• Basic statistics like averages and percentages

• How to think logically about cause and effect

• The ability to ask good business questions

Companies aren’t hiring data scientists to write academic paper; they’re hiring them to solve business problems using data. And business problems rarely require PhD-level mathematics.

Start with tools like Excel or Google Sheets before moving to Python, and focus on solving real problems rather than memorizing formulas.

Fear 2: You think you’re too old or too late to break into the field.

I regularly work with career changers in their 40s, 50s, and even 60s who successfully transition into data science roles.

Your years of industry experience are actually your secret weapon. While 22-year-old computer science graduates know algorithms, they don’t understand business context. They can’t walk into a marketing meeting and immediately understand why customer acquisition costs matter, or sit with finance teams and grasp cash flow implications.

Your domain expertise makes you incredibly valuable because you can:

• Ask the right business questions from day one

• Spot data quality issues that newcomers miss

• Communicate findings to stakeholders in language they understand

• Bridge the gap between technical analysis and business strategy

Don’t let ageism fears hold you back. Instead, lean into your experience as your competitive advantage.

Fear 3: You’re overwhelmed by the constantly changing technology landscape.

Every week there’s a new AI tool, a new Python library, or a breakthrough model that everyone’s talking about.

But here’s the secret: the fundamentals haven’t changed in decades. Data cleaning, exploratory analysis, visualization, and statistical modeling are still the core 80% of any data science project. The tools evolve, but the underlying process remains remarkably consistent.

Focus on mastering these timeless skills:

• How to clean messy data

• How to create compelling visualizations

• How to test hypotheses with data

• How to present findings to non-technical audiences

Once you have these foundations, picking up new tools becomes much easier because you understand what you’re trying to accomplish. You’re not learning technology for technology’s sake, you’re learning tools to solve problems you already understand.

Fear 4: You assume you need years of coding experience to be effective.

Most people picture data scientists as hardcore programmers writing complex algorithms from scratch.

In reality, most data science work involves combining existing tools and libraries to solve business problems. You’re not building software, you’re analyzing data. Modern tools like Python’s pandas library, and no-code platforms like Orange Data Mining handle most of the heavy lifting for you.

Think of it like cooking: you don’t need to grow your own vegetables or mill your own flour to make a great meal. You combine existing ingredients in smart ways to create something valuable.

Start with point-and-click tools like Tableau or Power BI to build confidence, then gradually add coding skills as needed.

Fear 5: You’re afraid of making mistakes or looking incompetent in front of colleagues.

This fear keeps more talented people out of data science than any technical barrier.

But here’s what I learned after many years in this field: everyone makes mistakes, even senior data scientists. The difference between beginners and experts isn’t that experts don’t make mistakes, it’s just that experts have made so many mistakes they’ve learned how to find and fix them quickly.

Data science is inherently experimental. You form hypotheses, test them, and iterate based on what you learn. Mistakes aren’t failures, they’re information that helps you refine your approach.

Start small with low-stakes projects where mistakes won’t matter. Analyze your own personal data, volunteer for non-profit organizations, or work on side projects where the only person judging your work is you. Build confidence in private before going public with your skills.

The data science revolution is accelerating. While you’re sitting on the sidelines letting fear hold you back, opportunities are passing you by every single day. But now you know the truth: these fears are based on myths, not reality.

Your experience matters more than your age. Your business acumen matters more than your coding skills. Your curiosity matters more than your mathematics background.

The question isn’t whether you’re qualified to learn data science. The real question is whether you feel ready to honor your potential and make career decisions that reflect your true capabilities.

User Avatar

John Lynn

1y ago

What if your greatest career asset has been hiding in plain sight?

For months now, you've been wrestling with a question that keeps you awake at night: can someone with your background truly succeed in data science? You've spent hours researching bootcamps, online courses, and degree programs, each promising to transform you into a data scientist.

Yet something feels fundamentally wrong about starting over, as if your years of professional experience suddenly became worthless the moment you decided to pursue this new path.

The nagging voice in your head whispers that you're too old, too late, and too far behind to compete with fresh graduates who've been coding since secondary school.

Here's the truth that will change everything: your domain expertise isn't your weakness—it's your secret weapon.

User Avatar

John Lynn

2y ago

Everybody has a first
John Lynn

This is a post, my very first post. I'm trying to fight the urge to go find me some Lorem Ipsum to paste in here, because well that would just be lame. I just want to create a post, just to see what it will look like.

I'm noticing that the templates over there <-- on the left look mighty intriguing, so I clicked on a few to see what they're like. But seems like every template is only available to upgraded accounts. I'll get there, probably sooner than later. There doesn't seem to be any free ones, which is sad because I just wanted to check out the mechanism; for instance, how the template gets instantiated here in my post.

In closing, I'd like to say that this is a pleasant writing experience so far. Looking forward to what else is here. Thank you for your readership, my devoted followers.