Skip to content

25-08-2025

Choose a tag to compare

@fulleni fulleni released this 25 Aug 21:19
· 330 commits to main since this release

🚀 A New, Specialized Country Query Service

To support more advanced filtering needs that go beyond simple data lookups, we've implemented a dedicated service that leverages the power of MongoDB's aggregation framework. This provides a robust and efficient solution for complex data discovery.

  • 🎯 Introduced CountryQueryService: A new service was launched to handle complex queries, such as finding countries with active sources or headlines. It features an in-memory cache with a 15-minute TTL to dramatically boost performance for frequent requests. #53
  • 🔧 Refined Aggregation Logic: The service's MongoDB aggregation pipeline was improved to provide more accurate results by switching to a case-insensitive regex search and correcting Object ID comparisons in data lookups. #54

⚡️ API Refinements & Database Performance

Alongside the new service, we made key optimizations to the database and API to ensure these new capabilities are fast and easy to use.

  • 🔎 Implemented Country Name Filtering: The API now supports searching for countries by name. This is backed by a new text index on the countries collection to ensure these search queries are highly performant. #50
  • ⚙️ Optimized Query Parameters & Indexing: The country search parameter was updated from name to the more conventional q. Additionally, a new database index was added to significantly speed up queries that filter headlines by the event country's name. #51