RemoveIndex removes a single index with the specified name from the current collection.
(name string)
| 672 | |
| 673 | // RemoveIndex removes a single index with the specified name from the current collection. |
| 674 | func (m *Collection) RemoveIndex(name string) { |
| 675 | for i, idx := range m.Indexes { |
| 676 | if strings.EqualFold(dbutils.ParseIndex(idx).IndexName, name) { |
| 677 | m.Indexes = append(m.Indexes[:i], m.Indexes[i+1:]...) |
| 678 | return |
| 679 | } |
| 680 | } |
| 681 | } |
| 682 | |
| 683 | // delete hook |
| 684 | // ------------------------------------------------------------------- |