Skip to content

Commit e88fb05

Browse files
committed
fix(country): replace text search with regex for case-insensitive search
- Replaced MongoDB text search with a case-insensitive regex search - This change affects the 'q' parameter handling in the CountryQueryService - The modification improves search functionality by making it case-insensitive
1 parent 0b9354c commit e88fb05

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/src/services/country_query_service.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ class CountryQueryService {
131131
final qValue = filter['q'];
132132
if (qValue is String && qValue.isNotEmpty) {
133133
compoundMatchStages.add({
134-
r'$text': {r'$search': qValue},
134+
'name': {
135+
r'$regex': qValue,
136+
r'$options': 'i', // Case-insensitive
137+
},
135138
});
136139
}
137140

0 commit comments

Comments
 (0)