Skip to content

Commit

Permalink
remove invalid regex modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
morphy2k committed Mar 25, 2023
1 parent b24147f commit cb6bd5c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion model/hideout/module/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func GetByText(q string, opts *Options) (*model.Result, error) {

var filter interface{}

filter = bson.M{"name": primitive.Regex{Pattern: fmt.Sprintf("%s", re), Options: "gi"}}
filter = bson.M{"name": primitive.Regex{Pattern: fmt.Sprintf("%s", re), Options: "i"}}

count, err := c.CountDocuments(ctx, filter)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions model/item/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ func GetByText(q string, opts *Options, kind Kind) (*model.Result, error) {
filter := bson.D{
{Key: "_kind", Value: kind},
{Key: "$or", Value: bson.A{
bson.M{"shortName": primitive.Regex{Pattern: fmt.Sprintf("%s", re), Options: "gi"}},
bson.M{"name": primitive.Regex{Pattern: fmt.Sprintf("%s", re), Options: "gi"}},
bson.M{"shortName": primitive.Regex{Pattern: fmt.Sprintf("%s", re), Options: "i"}},
bson.M{"name": primitive.Regex{Pattern: fmt.Sprintf("%s", re), Options: "i"}},
}},
}

Expand Down
2 changes: 1 addition & 1 deletion model/location/feature/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func GetByText(q, loc string, opts *Options) (*model.Result, error) {

filter = bson.D{
{Key: "_location", Value: lID},
{Key: "name", Value: primitive.Regex{Pattern: fmt.Sprintf("%s", re), Options: "gi"}},
{Key: "name", Value: primitive.Regex{Pattern: fmt.Sprintf("%s", re), Options: "i"}},
}

count, err := c.CountDocuments(ctx, filter)
Expand Down
2 changes: 1 addition & 1 deletion model/location/featuregroup/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func GetByText(q, loc string, opts *Options) (*model.Result, error) {

filter = bson.D{
{Key: "_location", Value: lID},
{Key: "name", Value: primitive.Regex{Pattern: fmt.Sprintf("%s", re), Options: "gi"}},
{Key: "name", Value: primitive.Regex{Pattern: fmt.Sprintf("%s", re), Options: "i"}},
}

count, err := c.CountDocuments(ctx, filter)
Expand Down
2 changes: 1 addition & 1 deletion model/location/location.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func GetByText(q string, opts *Options) (*model.Result, error) {

var filter interface{}

filter = bson.M{"name": primitive.Regex{Pattern: fmt.Sprintf("%s", re), Options: "gi"}}
filter = bson.M{"name": primitive.Regex{Pattern: fmt.Sprintf("%s", re), Options: "i"}}

count, err := c.CountDocuments(ctx, filter)
if err != nil {
Expand Down

0 comments on commit cb6bd5c

Please sign in to comment.