Documentation ¶
Index ¶
- func Count(dbname, collname string, spec map[string]any) int
- func Distinct(dbname, collname, field string) ([]any, error)
- func Get(dbname, collname string, spec map[string]any, idx, limit int) []map[string]any
- func GetSorted(dbname, collname string, spec map[string]any, skeys []string, ...) []map[string]any
- func InitDB(dbDir string) error
- func Insert(dbname, collname string, records []map[string]any)
- func InsertRecord(dbname, collname string, rec map[string]any) error
- func Remove(dbname, collname string, spec map[string]any) error
- func Update(dbname, collname string, spec, newdata map[string]any)
- func Upsert(dbname, collname, attr string, records []map[string]any) error
- type EmbedDB
- func (d *EmbedDB) Count(dbname, collname string, spec map[string]any) int
- func (d *EmbedDB) Distinct(dbname, collname, field string) ([]any, error)
- func (d *EmbedDB) Get(dbname, collname string, spec map[string]any, idx, limit int) []map[string]any
- func (d *EmbedDB) GetSorted(dbname, collname string, spec map[string]any, skeys []string, ...) []map[string]any
- func (d *EmbedDB) InitDB(uri string)
- func (d *EmbedDB) Insert(dbname, collname string, records []map[string]any)
- func (d *EmbedDB) InsertRecord(dbname, collname string, rec map[string]any) error
- func (d *EmbedDB) Remove(dbname, collname string, spec map[string]any) error
- func (d *EmbedDB) Update(dbname, collname string, spec, newdata map[string]any)
- func (d *EmbedDB) Upsert(dbname, collname, attr string, records []map[string]any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSorted ¶
func GetSorted(dbname, collname string, spec map[string]any, skeys []string, sortOrder, idx, limit int) []map[string]any
GetSorted fetches records from document-oriented db sorted by given key with specific order
func InsertRecord ¶
InsertRecord insert record with given spec to document-oriented db
Types ¶
type EmbedDB ¶ added in v0.5.9
type EmbedDB struct { }
EmbedDB represent embedded database
func (*EmbedDB) Count ¶ added in v0.5.9
Count returns total number of records within database/collection and given spec
func (*EmbedDB) Get ¶ added in v0.5.9
func (d *EmbedDB) Get(dbname, collname string, spec map[string]any, idx, limit int) []map[string]any
Get fetches data from underlying database/collection
func (*EmbedDB) GetSorted ¶ added in v0.5.9
func (d *EmbedDB) GetSorted(dbname, collname string, spec map[string]any, skeys []string, sortOrder, idx, limit int) []map[string]any
GetSorted returns sorted records from given database/collection using provided spec, sorted keys, order and limits
func (*EmbedDB) InsertRecord ¶ added in v0.5.9
InsertRecord inserts single record into given database/collection
func (*EmbedDB) Remove ¶ added in v0.5.9
Remove deletes records in given database/collection using given spec
Click to show internal directories.
Click to hide internal directories.