Atlas Search Soccer
Build your Soccer Dream Team with MongoDB Atlas Search
Every four years, for the sake of blending in, I pretend to know soccer. When the World Cup is on, I’m overwhelmed by the exuberant fans with colorful soccer jerseys. Jerseys with unfamiliar names from far away places. I recognize Messi and Ronaldo, but the others …? Mkhitaryan, Szczęsny, Großkreutz? How can I look up their stats to feign familiarity when I have no idea how to spell their names?
Well, now there's this app for that. Atlas Search Soccer is an interactive Atlas Search tutorial and instant sports bar credibility builder.
Teaming up MongoDB Atlas Search with an extensive player dataset, you can scout across the over 22,000 players in the database based on a variety of search parameters and data types:
- player name
- player position
- skill level
Equipped with only a search box, sliders and checkboxes, find the world's best players with the most impossible-to-spell names to build out your own Soccer Dream Team. Autocomplete, wildcard, and filters to find Ibrahimović, Błaszczykowski, and Szczęsny? No problem!
As you interact with the application, you'll see the
$search operator in a MongoDB aggregation pipeline live in-action!
When you pick a footballer for your team, he is written to local storage on your device. That way, your Dream Team stays warmed up and on the pitch even after you close your browser.
Skills and Drills
- search operators:
- fuzzy matching
- indexes and analyzers
- compound operator
- relevance based scoring
- custom score modifiers
- filters, facets and counts
So give it a shot, and you'll be an Atlas Search pro in no time!
Game Notes 📝
This application hosted entirely by MongoDB Atlas was created using:
- Tailwind CSS
- Atlas App Services for backend HTTPs endpoints and webhooks
- A FIFA22 player dataset
Currently this app is not suitable for mobile, but feel free to send a PR. 😊
Want to play in your own stadium? Here's how to build Atlas Search Soccer on your own free cluster.
Atlas Search Soccer runs on a very streamlined game plan where MongoDB Atlas is the MVP. No additional servers or software needed. No need to keep data in sync. Everything is done in MongoDB Atlas.
- A MongoDB Atlas account. Get one for free here.
- A recent version of Node.js and npm.
- Extensive worldwide player dataset (players22.json) provided in the data folder.
- (Recommended) MongoDB Compass - GUI
It is also included in this repo's data folder as
To Run This Application....
- Clone the repo.
- Navigate inside
Load data to Atlas cluster:
Using Atlas App Services as Your Serverless Backend....
AtlasSearchSoccer uses HTTP services in App Services to create 5 APIs to allow you to query for your player data over HTTP:
The data is queried from
useHomeFetch.js in the
Here you'll find the endpoints for the backend search queries using the
FacetsEndPointFind the code for these webhooks in the
If you have any questions or feedback about this repo, feel free to create an Issue or PR in this repo or reach out to me on Twitter @YouOldMaid.
Also please join our online MongoDB Community to interact with our product and engineering teams along with thousands of other MongoDB and Realm users.
Have fun and happy coding!
Use at your own risk; not a supported MongoDB product