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

Implement the Konami Keystroke Cheat Code in a Unity Game

Remember all the cheat codes you could use in old-school games back in the day? Remember the Konami cheat code? Ever wonder how you could add cheat codes to your own games?

Adding cheat codes to your game is a great way to leave your imprint. Think easter eggs, but even more secretive.

In this tutorial we’re going to see how to add keystroke driven cheat codes to a game built with Unity and C#. While the Konami cheat code will be the basis of this example, a lot of the logic and ideas can be applied to other aspects of your game.

Read More

Building a Space Shooter Game that Syncs with Unity and MongoDB Realm

When developing a game, in most circumstances you’re going to need to store some kind of data. It could be the score, it could be player inventory, it could be where they are located on a map. The possibilities are endless and it’s more heavily dependent on the type of game.

Need to sync that data between devices and your remote infrastructure? That is a whole different scenario.

If you managed to catch MongoDB .Live 2021, you’ll be familiar that the first stable release of the MongoDB Realm SDK for Unity was made available. This means that you can use Realm in your Unity game to store and sync data with only a few lines of code.

In this tutorial, we’re going to build a nifty game that explores some storage and syncing use-cases.

Read More

Get Hyped: Using Docker + Go with MongoDB

In the developer community, ensuring your projects run accurately regardless of the environment can be a pain. Whether it’s trying to recreate a demo from an online tutorial or working on a code review, hearing the words, “Well, it works on my machine…” can be frustrating. Instead of spending hours debugging, we want to introduce you to a platform that will change your developer experience: Docker.

Docker is a great tool to learn because it provides developers with the ability for their applications to be used easily between environments, and it’s resource-efficient in comparison to virtual machines. This tutorial will gently guide you through how to navigate Docker, along with how to integrate Go on the platform. We will be using this project to connect to our previously built MongoDB Atlas Search Cluster made for using Synonyms in Atlas Search. Stay tuned for a fun read on how to learn all the above while also expanding your Gen-Z slang knowledge from our synonyms cluster. Get hyped!

Read More

Get Hyped: Synonyms in MongoDB Atlas Search

Sometimes, the word you’re looking for is on the tip of your tongue, but you can’t quite grasp it. For example, when you’re trying to find a really funny tweet you saw last night to show your friends. If you’re sitting there reading this and thinking, “Wow, Anaiya and Nic, you’re so right. I wish there was a fix for this,” strap on in! We have just the solution for those days when your precise linguistic abilities fail you, but you have an idea of what you’re looking for: Synonyms in Atlas Search.

In this tutorial, we are going to be showing you how to index a MongoDB collection to capture searches for words that mean similar things. For the specifics, we’re going to search through content written with Generation Z (Gen-Z) slang. The slang will be mapped to common words with synonyms and as a result, you’ll get a quick Gen-Z lesson without having to ever open TikTok.

If you’re in the mood to learn a few new words, alongside how effortlessly synonym mappings can be integrated into Atlas Search, this is the tutorial for you.

Read More

Influence Search Result Ranking with Function Scores in Atlas Search

When it comes to natural language searching, it’s useful to know how the order of the results for a query were determined. Exact matches might be obvious, but what about situations where not all the results were exact matches due to a fuzzy parameter, the $near operator, or something else?

This is where the document score becomes relevant.

Every document returned by a $search query in MongoDB Atlas Search is assigned a score based on relevance, and the documents included in a result set are returned in order from highest score to lowest.

You can choose to rely on the scoring that Atlas Search determines based on the query operators, or you can customize its behavior using function scoring and optimize it towards your needs. In this tutorial, we’re going to see how the function option in Atlas Search can be used to rank results in an example.

Read More

An Introduction to Indexes for MongoDB Atlas Search

Imagine reading a long book like “A Song of Fire and Ice,” “The Lord of the Rings,” or “Harry Potter.” Now imagine that there was a specific detail in one of those books that you needed to revisit. You wouldn’t want to search every page in those long books to find what you were looking for. Instead, you’d want to use some sort of book index to help you quickly locate what you were looking for. This same concept of indexing content within a book can be carried to MongoDB Atlas Search with search indexes.

Atlas Search makes it easy to build fast, relevant, full-text search on top of your data in the cloud. It’s fully integrated, fully managed, and available with every MongoDB Atlas cluster running MongoDB version 4.2 or higher.

Correctly defining your indexes is important because they are responsible for making sure that you’re receiving relevant results when using Atlas Search. There is no one-size-fits-all solution and different indexes will bring you different benefits.

In this tutorial, we’re going to get a gentle introduction to creating indexes that will be valuable for various full-text search use cases.

Read More

Searching on Your Location with Atlas Search and Geospatial Operators

When thinking about full-text search, text and other string data is probably the first thing to come to mind. In fact, if you’ve been keeping up with my tutorials, you might remember Building an Autocomplete Form Element with Atlas Search and JavaScript or Visually Showing Atlas Search Highlights with JavaScript and HTML, both of which were on text search examples in MongoDB Atlas Search.

Being able to use natural language search on text data is probably one of the most popular use-cases, but there are scenarios where you might need to narrow the results even further.

Let’s say you’re building a restaurant review application like Yelp or a bed and breakfast booking system like Airbnb. Sure, you’ll enter some kind of text criteria for what you’re looking for, but there’s also a location aspect to it. For example, if you want to find a place to get a cheeseburger within walking distance of your current location, you probably don’t want your search results to contain entries from another country. This is an example of a geo search, where you would want to return results based on location coordinates.

In this tutorial, we’re going to see how to use Atlas Search and the compound operator to search based on text entered and within a certain geographical area. For the text entered, we’ll use the autocomplete operator, and for the geospatial component, we’ll use the geoWithin operator.

Read More