// FindAllWithFields returns all the documents with given fields based on a given query
19086
func (s *DbSession) FindAllWithFields(query Q, fields []string, document Document) (interface{}, error) {
	fn := func(q *mgo.Query, result interface{}) error {
		return q.Select(sel(fields...)).All(result)
	}
	return s.executeFindAll(query, document, fn)
}
323198
func (l *Logger) WithFields(fields Fielder) *Entry {
	return NewEntry(l).WithFields(fields.Fields())
}
673107
func (sp statePersistence) All(collName string, query, docs interface{}) error {
	coll, closeColl := sp.st.db().GetCollection(collName)
	defer closeColl()

	if err := coll.Find(query).All(docs); err != nil {
		return errors.Trace(err)
	}
	return nil
}
616512
func (q MoreLikeThisQuery) Fields(fields ...string) MoreLikeThisQuery {
	q.fields = append(q.fields, fields...)
	return q
}
520301
func (c Context) Fields(fields map[string]interface{}) Context {
	c.l.context = appendFields(c.l.context, fields)
	return c
}
466657
func (s *DbSession) findQuery(d Document, q Q) *mgo.Query {
	//collection pointer for the given document
	return s.collection(d.CollectionName()).Find(q)
}
942208
func (query Query) All(record interface{}) error {
	_, err := query.repo.adapter.All(query, record, query.repo.logger...)
	return err
}
1033123
func WithFields(fields ...Field) Entry {
	ne := newEntryWithFields(logFields)
	ne.Fields = append(ne.Fields, fields...)
	return ne
}
1231905
func (s *shim) WithFields(fields log.Fields) log.Logger {
	lg := s.logger.With().Fields(fields).Logger()
	s.logger = &lg

	return s
}
228091
func (q *Query) All(models interface{}) error {
	err := q.Connection.timeFunc("All", func() error {
		m := &Model{Value: models}
		err := q.Connection.Dialect.SelectMany(q.Connection.Store, m, *q)
		if err != nil {
			return err
		}
		err = q.paginateModel(models)
		if err != nil {
			return err
		}
		return m.afterFind(q.Connection)
	})

	if err != nil {
		return errors.Wrap(err, "unable to fetch records")
	}

	if q.eager {
		err = q.eagerAssociations(models)
		q.disableEager()
		return err
	}

	return nil
}
431320
func WithFields(fields map[string]interface{}, message string) Goof {
	return WithFieldsE(fields, message, nil)
}
837857
func (s *session) FindFields(keys KeyList, container TableListContainer, fields ...string) error {
	action, err := s.find(keys, container, getOptions{}, fields)
	if err != nil {
		return s.catch("Find: "+action, err)
	}
	return nil
}
250788
func (entry *Entry) WithFields(fields lg.Fields) *Entry {
	data := make(lg.Fields, len(entry.fields)+len(fields))
	for k, v := range entry.fields {
		data[k] = v
	}
	for k, v := range fields {
		data[k] = v
	}
	return &Entry{logger: entry.logger, fields: data, lgEntry: entry.lgEntry}
}
130924
func (c *cachedDocs) hasFields(fields []string) bool {
	c.m.Lock()
	for _, field := range fields {
		if _, exists := c.cache[field]; !exists {
			c.m.Unlock()
			return false // found a field not in cache
		}
	}
	c.m.Unlock()
	return true
}
180166
func (i *indexImpl) Fields() (fields []string, err error) {
	i.mutex.RLock()
	defer i.mutex.RUnlock()

	if !i.open {
		return nil, ErrorIndexClosed
	}

	indexReader, err := i.i.Reader()
	if err != nil {
		return nil, err
	}
	defer func() {
		if cerr := indexReader.Close(); err == nil && cerr != nil {
			err = cerr
		}
	}()

	fields, err = indexReader.Fields()
	if err != nil {
		return nil, err
	}
	return fields, nil
}
357586
func (item *MoreLikeThisQueryItem) Fields(fields ...string) *MoreLikeThisQueryItem {
	item.fields = append(item.fields, fields...)
	return item
}
332311
func (self *Collection) AddFields(fields ...Field) *Collection {
	self.Fields = append(self.Fields, fields...)
	return self
}