func (bndl *Bundle) FindSet(keys ...Key) (*Set, error) {
    dbund, err := bndl.FindBundle(DecodeSet, keys...)
    if err != nil {
        return nil, err
    }
    return setFromBundle(dbund)
}
Shortcut to find a Set collection
package bundledb
import (
    "fmt"
    "bytes"
    "errors"
    "github.com/hansonkd/bundledb/store"
)
var (
    InvalidHeader = errors.New("Invalid Header for object")
    EmbeddedNotFound = errors.New("Invalid Header for object")
    MapPaths = []Decoder{DecodeMap}
    DecodeSet = setType{}
    DecodeTuple = tupleType{}
    DecodeMap = mapType{}
    DecodeList = listType{}
    DecodeTimeline = timelineType{}
)
type Bundle struct {
    iBundle
    cache map[Key]*Bundle
    rootPath []Key
    txn *store.Txn
}
func newBundle(txn *store.Txn, rootPath []Key, primType Decoder, primBytes []byte) (*Bundle, error) {
    var v iBundle
    var err error
    switch  {
    case primType.IsPrimitive(primBytes):
        v, err = newPrimitiveBundle(primType, primBytes, txn.CanWrite())
    case primType.IsPointer(primBytes):
        v, err = newShardBundle(txn, primType, primBytes)
    default:
        fmt.Println("err", rootPath, len(primBytes))
        return nil, InvalidHeader
    }
    return &Bundle{v, make(map[Key]*Bundle), rootPath, txn}, err
}
func (bndl *Bundle) Primitive(key Key) (Primitive, error) {
    return bndl.iBundle.Primitive(key)
}
func (bndl *Bundle) Iterator() (BundleIterator, error) {
    return bndl.iBundle.Iterator()
}
func (bndl *Bundle) Read(key Key) (Value, bool, error) {
    prim, err := bndl.Primitive(key)
    if err != nil {
        return nil, false, err
    }
    value, exists := prim.Read(key)
    return value, exists, nil
}
func (bndl *Bundle) Write(key Key, value Value) (bool, error) {
    prim, err := bndl.Primitive(key)
    if err != nil {
        return false, err
    }
    exists := prim.Write(key, value)
    return exists, err
}
func (bndl *Bundle) Delete(key Key) (bool, error) {
    prim, err := bndl.Primitive(key)
    if err != nil {
        return false, err
    }
    exists := prim.Delete(key)
    return exists, err
}
func (bndl *Bundle) FindBundle(final Decoder, keys ...Key) (*Bundle, error) {
    return bndl.FindBundleWithCycle(final, MapPaths, keys...)
}
func (bndl *Bundle) FindList(keys ...Key) (*List, error) {
    dbund, err := bndl.FindBundle(DecodeList, keys...)
    if err != nil {
        return nil, err
    }
    return listFromBundle(dbund)
}
func (bndl *Bundle) FindMap(keys ...Key) (*Map, error) {
    dbund, err := bndl.FindBundle(DecodeMap, keys...)
    if err != nil {
        return nil, err
    }
    return mapFromBundle(dbund)
}
func (bndl *Bundle) FindTimeline(keys ...Key) (*Timeline, error) {
    dbund, err := bndl.FindBundle(DecodeTimeline, keys...)
    if err != nil {
        return nil, err
    }
    return timelineFromBundle(dbund)
}