mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-29 05:38:45 +08:00
fix: get group return repeated result (#2842)
This commit is contained in:
parent
d4d626606b
commit
9e4cad1815
@ -76,7 +76,7 @@ func (g *GroupMgo) Take(ctx context.Context, groupID string) (group *model.Group
|
|||||||
|
|
||||||
func (g *GroupMgo) Search(ctx context.Context, keyword string, pagination pagination.Pagination) (total int64, groups []*model.Group, err error) {
|
func (g *GroupMgo) Search(ctx context.Context, keyword string, pagination pagination.Pagination) (total int64, groups []*model.Group, err error) {
|
||||||
// Define the sorting options
|
// Define the sorting options
|
||||||
opts := options.Find().SetSort(bson.D{{Key: "created_at", Value: -1}})
|
opts := options.Find().SetSort(bson.D{{Key: "create_time", Value: -1}})
|
||||||
|
|
||||||
// Perform the search with pagination and sorting
|
// Perform the search with pagination and sorting
|
||||||
return mongoutil.FindPage[*model.Group](ctx, g.coll, bson.M{
|
return mongoutil.FindPage[*model.Group](ctx, g.coll, bson.M{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user