@@ -190,17 +190,26 @@ func (c *Collection) aggregateFilter(ctx context.Context, p usecasex.Pagination,
190
190
}
191
191
192
192
func findOptionsFromPagination (p usecasex.Pagination , s * usecasex.Sort ) * options.FindOptions {
193
- o := options .Find ().SetAllowDiskUse (true ).SetLimit (limit (p ))
193
+ o := options .Find ().SetAllowDiskUse (true ).SetLimit (limit (p ))
194
194
195
- if p .Offset != nil {
196
- o = o .SetSkip (p .Offset .Offset )
197
- }
195
+ if p .Offset != nil {
196
+ o = o .SetSkip (p .Offset .Offset )
197
+ }
198
198
199
- return o .SetCollation (& options.Collation {Strength : 1 , Locale : "simple" }).SetSort (sortFilter (p , s ))
199
+ collation := options.Collation {
200
+ Locale : "en" ,
201
+ Strength : 2 ,
202
+ }
203
+
204
+ return o .SetCollation (& collation ).SetSort (sortFilter (p , s ))
200
205
}
201
206
202
207
func aggregateOptionsFromPagination (_ usecasex.Pagination , _ * usecasex.Sort ) * options.AggregateOptions {
203
- return options .Aggregate ().SetAllowDiskUse (true ).SetCollation (& options.Collation {Strength : 1 , Locale : "simple" })
208
+ collation := options.Collation {
209
+ Locale : "en" ,
210
+ Strength : 2 ,
211
+ }
212
+ return options .Aggregate ().SetAllowDiskUse (true ).SetCollation (& collation )
204
213
}
205
214
206
215
func (c * Collection ) pageFilter (ctx context.Context , p usecasex.Pagination , s * usecasex.Sort ) (any , error ) {
@@ -256,11 +265,11 @@ func (c *Collection) pageFilter(ctx context.Context, p usecasex.Pagination, s *u
256
265
}
257
266
258
267
func sortFilter (p usecasex.Pagination , s * usecasex.Sort ) bson.D {
259
- var sortOptions bson.D
260
- if s != nil && s .Key != "" && s .Key != idKey {
261
- sortOptions = append (sortOptions , bson.E {Key : s .Key , Value : sortDirection (p , s )})
262
- }
263
- return append (sortOptions , bson.E {Key : idKey , Value : sortDirection (p , s )})
268
+ var sortOptions bson.D
269
+ if s != nil && s .Key != "" && s .Key != idKey {
270
+ sortOptions = append (sortOptions , bson.E {Key : s .Key , Value : sortDirection (p , s )})
271
+ }
272
+ return append (sortOptions , bson.E {Key : idKey , Value : sortDirection (p , s )})
264
273
}
265
274
266
275
func limit (p usecasex.Pagination ) int64 {
0 commit comments