Пример #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
}
Пример #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}
}