func (iv IndexView) CreateOne(ctx context.Context, model IndexModel, opts ...*options.CreateIndexesOptions) (string, error) {
	names, err := iv.CreateMany(ctx, []IndexModel{model}, opts...)
	if err != nil {
		return "", err
	}

	return names[0], nil
}
// CreateOne executes a createIndexes command to create an index on the collection and returns the name of the new
// index. See the IndexView.CreateMany documentation for more information and an example.
CreateOne executes a createIndexes command to create an index on the collection and returns the name of the new
index. See the IndexView.CreateMany documentation for more information and an example.
// CreateOne executes a createIndexes command to create an index on the collection and returns the name of the new // index . See the IndexView . CreateMany documentation for more information and an example .
func (iv IndexView) CreateOne(ctx context.Context, model IndexModel, opts ...*options.CreateIndexesOptions) (string, error) {
	names, err := iv.CreateMany(ctx, []IndexModel{model}, opts...)
	if err != nil {
		return "", err
	}
	return names[0], nil
}
func ( iv IndexView ) CreateOne ( ctx context . Context , model IndexModel , opts ... * options . CreateIndexesOptions ) ( string , error ) { names , err := iv . CreateMany ( ctx , [ ] IndexModel { model } , opts ... ) if err != nil { return " " , err } return names [ 0 ] , nil }
CreateOne executes a createIndexes command to create an index on the collection and returns the name of the new
index.
CreateOne executes a createIndexes command to create an index on the collection and returns the name of the new index .