Skip to content

Commit

Permalink
chore(server): upgrade reearthx version (#1098)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyshx authored Aug 9, 2024
1 parent 33aa72c commit 08d54a2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/paulmach/go.geojson v1.4.0
github.com/pkg/errors v0.9.1
github.com/ravilushqa/otelgqlgen v0.15.0
github.com/reearth/reearthx v0.0.0-20240809042445-586dfb9c441b
github.com/reearth/reearthx v0.0.0-20240809105752-94879dbf747b
github.com/samber/lo v1.39.0
github.com/spf13/afero v1.11.0
github.com/square/mongo-lock v0.0.0-20201208161834-4db518ed7fb2
Expand Down
2 changes: 2 additions & 0 deletions server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,8 @@ github.com/ravilushqa/otelgqlgen v0.15.0 h1:U85nrlweMXTGaMChUViYM39/MXBZVeVVlpuH
github.com/ravilushqa/otelgqlgen v0.15.0/go.mod h1:o+1Eju0VySmgq2BP8Vupz2YrN21Bj7D7imBqu3m2uB8=
github.com/reearth/reearthx v0.0.0-20240809042445-586dfb9c441b h1:1flLX4/85flJme++BapI9bi81I1mkd2qJ5nBVpTAXY4=
github.com/reearth/reearthx v0.0.0-20240809042445-586dfb9c441b/go.mod h1:d1WXkdCVzSoc8pl3vW9/9yKfk4fdoZQZhX8Ot8jqgnc=
github.com/reearth/reearthx v0.0.0-20240809105752-94879dbf747b h1:Vt1oXaj7pntxlQoKi/zJwvMHovlM86sYweOOx2rlH7Q=
github.com/reearth/reearthx v0.0.0-20240809105752-94879dbf747b/go.mod h1:d1WXkdCVzSoc8pl3vW9/9yKfk4fdoZQZhX8Ot8jqgnc=
github.com/robertkrimen/godocdown v0.0.0-20130622164427-0bfa04905481/go.mod h1:C9WhFzY47SzYBIvzFqSvHIR6ROgDo4TtdTuRaOMjF/s=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
Expand Down
12 changes: 11 additions & 1 deletion server/internal/infrastructure/mongo/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/reearth/reearthx/usecasex"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo/options"
)

var (
Expand Down Expand Up @@ -179,8 +180,17 @@ func (r *Project) paginate(ctx context.Context, filter any, sort *project.SortTy
}
}

collation := options.Collation{
Locale: "en",
Strength: 3,
CaseLevel: true,
Alternate: "shifted",
}

findOptions := options.Find().SetCollation(&collation)

c := mongodoc.NewProjectConsumer(r.f.Readable)
pageInfo, err := r.client.Paginate(ctx, filter, usort, pagination, c)
pageInfo, err := r.client.Paginate(ctx, filter, usort, pagination, c, findOptions)
if err != nil {
return nil, nil, rerror.ErrInternalByWithContext(ctx, err)
}
Expand Down

0 comments on commit 08d54a2

Please sign in to comment.