// Exists returns true when a value stored under the key exists
494141
func (section *Section) Exists(name string) bool {
	_, err := section.Get(name)
	return err == nil
}
1327828
func (db *Database) Exists() error {
	resp := &struct {
		Error  string `json:"error"`
		DBName string `json:"db_name"`
	}{}
	body, err := db.Req.Get("", nil)
	if err != nil {
		return err
	}
	err = json.Unmarshal(body, resp)
	if err != nil {
		return err
	}
	if resp.Error != "" {
		return errors.New(resp.Error)
	}

	return nil
}
542082
func Exists(field *gentypes.FieldType) interface{} {
	//u.Debugf("exists?  nested?%v  for %s", field.Nested(), field.String())
	if field.Nested() {
		/*
			"nested": {
				"query": {
				    "term": {
				        "map_actioncounts.k": "Web hit"
				    }
				},
				"path": "map_actioncounts"
			}
		*/
		return &nested{&NestedQuery{
			Query: Term(field.Path+".k", field.Field),
			Path:  field.Path,
		}}
		//Nested(field.Path, &term{map[string][]string{"k": field.Field}})
	}
	return &exists{map[string]string{"field": field.Field}}
}
896138
func (json *JSON) Exists(name string) bool {
	return json.fetch(name).Exists()
}
160554
func (s *Service) Exists() (bool, error) {
	// In any error case, we just say it doesn't exist with this configuration.
	// Subsequent calls into the Service will give the caller more useful errors.
	_, same, _, err := s.existsAndSame()
	if err != nil {
		return false, errors.Trace(err)
	}
	return same, nil
}
513075
func (cfs *cacheFSObjects) Exists(ctx context.Context, bucket, object string) bool {
	_, err := cfs.GetObjectInfo(ctx, bucket, object, ObjectOptions{})
	return err == nil
}
1176871
func (self *CachingBackend) Exists(collection string, id interface{}) bool {
	return self.backend.Exists(collection, id)
}
387495
func (m *mruNonceMap) Exists(nonce uint64) bool {
	m.mtx.Lock()
	_, exists := m.nonceMap[nonce]
	m.mtx.Unlock()

	return exists
}
1335725
func (lir *LookupInResult) Exists(idx int) bool {
	return lir.contents[idx].exists()
}
1270336
func (self *Model) Exists(id interface{}) bool {
	return self.db.Exists(self.collection.Name, id)
}
1336423
func (r *RedisStore) Exists(key string) (bool, error) {
	cmd := r.client.Exists(key)
	return cmd.Val(), cmd.Err()
}
777809
func exists(ctx context.Context, db *gorm.DB, tableName, idColumnName, id string, softDeletable bool) (bool, error) {
	var exists bool
	var query string
	if softDeletable {
		query = fmt.Sprintf(`
		SELECT EXISTS (
			SELECT 1 FROM %[1]s
			WHERE
				%[2]s=$1
				AND deleted_at IS NULL
		)`, tableName, idColumnName)
	} else {
		query = fmt.Sprintf(`
		SELECT EXISTS (
			SELECT 1 FROM %[1]s
			WHERE
				%[2]s=$1
		)`, tableName, idColumnName)
	}
	err := db.CommonDB().QueryRow(query, id).Scan(&exists)
	if err == nil && !exists {
		return exists, errors.NewNotFoundError(tableName, id)
	}
	if err != nil {
		return false, errors.NewInternalError(ctx, errs.Wrapf(err, "unable to verify if %s exists", tableName))
	}
	return exists, nil
}
1286305
func (s *Etcd) Exists(key string) (bool, error) {
	_, err := s.Get(key)
	if err != nil {
		if err == store.ErrKeyNotFound {
			return false, nil
		}
		return false, err
	}
	return true, nil
}
1074545
func (g *Container) Exists(hierarchy ...string) bool {
	return g.Search(hierarchy...) != nil
}
990887
func (c ConnAdapter) Exists(path string) (bool, *zk.Stat, error) {
	return c.ExistsF(path)
}
1064850
func (nsRefcounts_) exists(coll mongo.Collection, key string) (bool, error) {
	count, err := coll.FindId(key).Count()
	if err != nil {
		return false, errors.Trace(err)
	}
	return count != 0, nil
}
587415
func (s *Key) Exists() bool {
	_, err := os.Stat(s.Path())
	if os.IsNotExist(err) {
		return false
	}

	return true
}