Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Update Array Elements in a Document with MQL Positional Operators

MongoDB offers a rich query language that’s great for create, read, update, and delete operations as well as complex multi-stage aggregation pipelines. There are many ways to model your data within MongoDB and regardless of how it looks, the MongoDB Query Language (MQL) has you covered.

One of the lesser recognized but extremely valuable features of MQL is in the positional operators that you’d find in an update operation.

Let’s say that you have a document and inside that document, you have an array of objects. You need to update one or more of those objects in the array, but you don’t want to replace the array or append to it. This is where a positional operator might be valuable.

In this tutorial, we’re going to look at a few examples that would benefit from a positional operator within MongoDB.

Read More

Zap, Tweet, and Repeat! How to Use Zapier with MongoDB

I’m a huge fan of automation when the scenario allows for it. Maybe you need to keep track of guest information when they RSVP to your event, or maybe you need to monitor and react to feeds of data. These are two of many possible scenarios where you probably wouldn’t want to do things manually.

There are quite a few tools that are designed to automate your life. Some of the popular tools include IFTTT, Zapier, and Automate. The idea behind these services is that given a trigger, you can do a series of events.

In this tutorial, we’re going to see how to collect Twitter data with Zapier, store it in MongoDB using a Realm webhook function, and then run aggregations on it using the MongoDB query language (MQL).

Read More

Create a Retro Gaming Handheld with a Raspberry Pi Zero and the Retroflag GPi Case

I’m a huge Raspberry Pi advocate and own more of them than any single person should own. They are cheap, moderately powerful, and are useful for quite a few circumstances.

In a previous tutorial titled, Emulate Classic Video Games On A Raspberry Pi Zero With RetroPie, I demonstrated how to repurpose an old Raspberry Pi Zero to be a gaming console about the size of an Amazon Fire Stick. For $5.00 to $10.00, these devices make retro gaming possible with little setup involved.

Recently, my buddy Mark Smith told me about the Retroflag GPi case, a case with a screen, speaker, and all the expectations of a handheld. This thing looks just like a classic Nintendo Gameboy, but has better hardware and is powered by a Raspberry Pi Zero. It is incredibly awesome.

In this tutorial, we’re going to go a step further. We’re going to take a Raspberry Pi Zero and combine it with a Retroflag GPi case to make a portable retro gaming powerhouse.

Read More

Capturing Hacker News Mentions with Node.js and MongoDB

If you’re in the technology space, you’ve probably stumbled upon Hacker News at some point or another. Maybe you’re interested in knowing what’s popular this week for technology or maybe you have something to share. It’s a platform for information.

The problem is that you’re going to find too much information on Hacker News without a particularly easy way to filter through it to find the topics that you’re interested in. Let’s say, for example, you want to know information about Bitcoin as soon as it is shared. How would you do that on the Hacker News website?

In this tutorial, we’re going to learn how to parse through Hacker News data as it is created, filtering for only the topics that we’re interested in. We’re going to do a sentiment analysis on the potential matches to rank them, and then we’re going to store this information in MongoDB so we can run reports from it. We’re going to do it all with Node.js and some simple pipelines.

Read More

Manage Game User Profiles with MongoDB, Phaser, and JavaScript

When it comes to game development, you’re almost always going to need to store information about your player. This information could be around how many health points you currently have in the game or it can extend beyond the game-play experience and into details such as the billing information for the person playing the game. When we talk about this type of data, we’re talking about a user profile store.

The user profile has everything about the user or player and doesn’t end at health points or billing information.

In this tutorial, we’re going to look at creating user profiles in a game that leverages the Phaser game development framework, JavaScript, and MongoDB.

Read More

Developing a Side-Scrolling Platformer Game with Unity and MongoDB Realm

I’ve been a gamer since the 1990s, so 2D side-scrolling platformer games like Super Mario Bros. hold a certain place in my heart. Today, 2D games are still being created, but with the benefit of having connectivity to the internet, whether that be to store your player state information, to access new levels, or something else.

Every year, MongoDB holds an internal company-wide hackathon known as Skunkworks. During Skunkworks, teams are created and using our skills and imagination, we create something to make MongoDB better or something that uses MongoDB in a neat way. For Skunkworks 2020, I (Nic Raboy) teamed up with Barry O’Neill to create a side-scrolling platformer game with Unity that queries and sends data between MongoDB and the game. Internally, this project was known as The Untitled Leafy Game.

In this tutorial, we’re going to see what went into creating a game like The Untitled Leafy Game using Unity as the game development framework and MongoDB Realm for data storage and back end.

Read More

My Activity Report For 2020

It’s that time of year again. It is time to reflect on the things that happened on The Polyglot Developer, what went well, what didn’t go so well, and what the upcoming year looks like.

If this is your first time stumbling on an annual report article for The Polyglot Developer, you won’t find any tutorial content. This is mostly a numbers-based reflection, but it could be useful if you’re interested in building your own blog, video channel, or overall brand.

In this particular activity report, we’ll follow the same formula as the 2019 report, which includes analyzing the written content on the blog, video tutorials on YouTube, the podcast and Twitch channel, and any services and operating costs required to keep the channels alive.

Read More


Follow Us


Subscribe to the newsletter for monthly tips and tricks on subjects such as mobile, web, and game development.

Support This Site