Exemple #1
0
func (db *GoDB) indexgeneric(field string, convert func(K, M) index_element) {
	db.mtx.Lock()
	defer db.mtx.Unlock()

	idx := &index{field, nil, convert}

	for it := bplus.GetAll(db.nodes, db.values); it.Valid(); it.Next() {
		idx.insert(K(it.Key()), decode(it.Value()))
	}

	db.indices[field] = idx
}
Exemple #2
0
// Returns an Iterator pointing to the first value in the data set.
func (db *GoDB) First() Iterator {
	return &iterator{bplus.GetAll(db.nodes, db.values), db}
}