Documentation ¶
Overview ¶
Document collection.
Collection management (Database is a collection of collections). Collection management functions may not be invoked concurrently.
Query processor for embedded and HTTP API V2.
Index ¶
- func EvalQueryV2(q interface{}, src *Col, result *map[uint64]struct{}) (err error)
- func GetIn(doc interface{}, path []string) (ret []interface{})
- func StrHash(thing interface{}) uint64
- func V2Complement(subExprs interface{}, src *Col, result *map[uint64]struct{}) (err error)
- func V2EvalAllIDs(src *Col, result *map[uint64]struct{}) (err error)
- func V2EvalUnion(exprs []interface{}, src *Col, result *map[uint64]struct{}) (err error)
- func V2IntRange(intFrom interface{}, expr map[string]interface{}, src *Col, ...) (err error)
- func V2Intersect(subExprs interface{}, src *Col, result *map[uint64]struct{}) (err error)
- func V2Lookup(lookupValue interface{}, expr map[string]interface{}, src *Col, ...) (err error)
- func V2PathExistence(hasPath interface{}, expr map[string]interface{}, src *Col, ...) (err error)
- func V2RegexpLookup(lookupRegexp interface{}, expr map[string]interface{}, src *Col, ...) (err error)
- type Col
- func (col *Col) BackupAndSaveConf() error
- func (col *Col) Close()
- func (col *Col) Delete(id uint64)
- func (col *Col) DeleteByUID(uid string)
- func (col *Col) DeserializeAll(template interface{}, fun func(id uint64) bool)
- func (col *Col) DurableDelete(id uint64) error
- func (col *Col) DurableInsert(doc interface{}) (id uint64, err error)
- func (col *Col) DurableUpdate(id uint64, doc interface{}) (newID uint64, err error)
- func (col *Col) Flush() error
- func (col *Col) ForAll(fun func(id uint64, doc interface{}) bool)
- func (col *Col) Index(path []string) error
- func (col *Col) IndexDoc(id uint64, doc interface{})
- func (col *Col) Insert(doc interface{}) (id uint64, err error)
- func (col *Col) InsertWithUID(doc interface{}) (newID uint64, newUID string, err error)
- func (col *Col) LoadConf() error
- func (col *Col) Read(id uint64, doc interface{}) error
- func (col *Col) ReadByUID(uid string, doc interface{}) (uint64, error)
- func (col *Col) ReassignUID(id uint64) (newID uint64, newUID string, err error)
- func (col *Col) Unindex(path []string) error
- func (col *Col) UnindexDoc(id uint64, doc interface{})
- func (col *Col) Update(id uint64, doc interface{}) (newID uint64, err error)
- func (col *Col) UpdateByUID(uid string, doc interface{}) (newID uint64, err error)
- type Config
- type DB
- type IndexConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EvalQueryV2 ¶
Main entrance to query processor - evaluate a query and put result into result map (as map keys).
func GetIn ¶
func GetIn(doc interface{}, path []string) (ret []interface{})
Resolve the attribute(s) in the document structure along the given path.
func StrHash ¶
func StrHash(thing interface{}) uint64
Return string hash code (algorithm inspired by Java String.hashCode())
func V2Complement ¶
Calculate complement of sub query results.
func V2EvalAllIDs ¶
Put all document IDs into result.
func V2EvalUnion ¶
Calculate union of sub-query results.
func V2IntRange ¶
func V2IntRange(intFrom interface{}, expr map[string]interface{}, src *Col, result *map[uint64]struct{}) (err error)
Scan hash table or collection documents using an integer range.
func V2Intersect ¶
Calculate intersection of sub query results.
func V2Lookup ¶
func V2Lookup(lookupValue interface{}, expr map[string]interface{}, src *Col, result *map[uint64]struct{}) (err error)
Execute value equity check ("attribute == value") using hash lookup or collection scan.
Types ¶
type Col ¶
type Col struct { Data *file.ColFile // Data file Config *Config // Index configuration Dir, ConfigFileName, ConfBackupFileName string // Directory and file names StrHT map[string]*file.HashTable // Index path to Hash Table mapping StrIC map[string]*IndexConf // Index path to index configuration mapping }
func (*Col) BackupAndSaveConf ¶
Copy existing index configuration to backup, then save the latest index configuration.
func (*Col) DeserializeAll ¶
Deserialize each document into template (pointer to an initialized struct), invoke the function on the deserialized document (Collection Scan).
func (*Col) DurableDelete ¶
Delete a document and immediately flush all buffers.
func (*Col) DurableInsert ¶
Insert a new document and immediately flush all buffers.
func (*Col) DurableUpdate ¶
Update a document and immediately flush all buffers.
func (*Col) ForAll ¶
Deserialize each document and invoke the function on the deserialized docuemnt (Collection Scsn).
func (*Col) InsertWithUID ¶
Insert a new document, and assign it a UID.
func (*Col) ReassignUID ¶
Give a document (identified by ID) a new UID.
func (*Col) UnindexDoc ¶
Remove the document from all indexes.