File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
internal/cli/deployments/search/indexes Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,10 @@ func (opts *CreateOpts) RunLocal(ctx context.Context) error {
120120 opts .indexID .Collection = index .CollectionName
121121 opts .indexID .Name = index .Name
122122
123- definition = index .Definition
123+ definition , err = buildIndexDefinition (index .Definition )
124+ if err != nil {
125+ return err
126+ }
124127 case * atlasv2.ClusterSearchIndex :
125128 _ , _ = log .Warningln ("you're using an old search index definition" )
126129 idxType = index .Type
@@ -163,7 +166,7 @@ func (opts *CreateOpts) RunLocal(ctx context.Context) error {
163166 return nil
164167}
165168
166- func buildIndexDefinition (idx * atlasv2. ClusterSearchIndex ) (any , error ) {
169+ func buildIndexDefinition (idx any ) (any , error ) {
167170 // To maintain formatting of the SDK, marshal object into JSON and then unmarshal into BSON
168171 jsonIndex , err := json .Marshal (idx )
169172 if err != nil {
You can’t perform that action at this time.
0 commit comments