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 {
	
	s := store.Copy()
	defer s.Close()

	
	for _, i := range i.indexes {
		
		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.
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 .