Skip to content

Commit

Permalink
update unified test suite.
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Sep 5, 2023
1 parent ceebe17 commit 0a4389c
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions mongo/integration/unified/collection_operation_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,17 @@ func executeCreateSearchIndex(ctx context.Context, operation *operation) (*opera

switch key {
case "model":
err = bson.Unmarshal(val.Document(), &model)
var m struct {
Definition interface{}
Name *string
}
err = bson.Unmarshal(val.Document(), &m)
if err != nil {
return nil, err
}
model.Definition = m.Definition
model.Options = options.SearchIndexes()
model.Options.Name = m.Name
default:
return nil, fmt.Errorf("unrecognized createSearchIndex option %q", key)
}
Expand Down Expand Up @@ -358,11 +365,19 @@ func executeCreateSearchIndexes(ctx context.Context, operation *operation) (*ope
return nil, err
}
for _, val := range vals {
var model mongo.SearchIndexModel
err = bson.Unmarshal(val.Value, &model)
var m struct {
Definition interface{}
Name *string
}
err = bson.Unmarshal(val.Value, &m)
if err != nil {
return nil, err
}
model := mongo.SearchIndexModel{
Definition: m.Definition,
Options: options.SearchIndexes(),
}
model.Options.Name = m.Name
models = append(models, model)
}
default:
Expand Down

0 comments on commit 0a4389c

Please sign in to comment.