coal/indexer.go
func (i *Indexer) Ensure(store *Store) error {
	// copy store
	s := store.Copy()
	defer s.Close()

	// go through all raw indexes
	for _, i := range i.indexes {
		// ensure single index
		err := s.DB().C(i.coll).EnsureIndex(i.index)
		if err != nil {
			return err
		}
	}

	return nil
}
func (i *Indexer) Ensure(store *Store) error {
	// copy store
	s := store.Copy()
	defer s.Close()

	// go through all raw indexes
	for _, i := range i.indexes {
		// ensure single index
		err := s.DB().C(i.coll).EnsureIndex(i.index)
		if err != nil {
			return err
		}
	}

	return nil
}
// Ensure will ensure that the required indexes exist. It may fail early if some
// of the indexes are already existing and do not match the supplied index.