Skip to content

Commit 0b9354c

Browse files
committed
fix(country): update aggregation queries for country IDs
- Change headquarters._id to headquarters.id in artist query - Change eventCountry._id to eventCountry.id in event query - Add $toString operator to ensure proper type comparison for countryId
1 parent 7b78c66 commit 0b9354c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/src/services/country_query_service.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,10 @@ class CountryQueryService {
163163
{
164164
r'$match': {
165165
r'$expr': {
166-
r'$eq': [r'$headquarters._id', r'$$countryId'],
166+
r'$eq': [
167+
r'$headquarters.id',
168+
{r'$toString': r'$$countryId'},
169+
],
167170
},
168171
'status': ContentStatus.active.name,
169172
},
@@ -191,7 +194,10 @@ class CountryQueryService {
191194
{
192195
r'$match': {
193196
r'$expr': {
194-
r'$eq': [r'$eventCountry._id', r'$$countryId'],
197+
r'$eq': [
198+
r'$eventCountry.id',
199+
{r'$toString': r'$$countryId'},
200+
],
195201
},
196202
'status': ContentStatus.active.name,
197203
},

0 commit comments

Comments
 (0)