docdb

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocDB added in v0.5.9

type DocDB interface {
	InitDB(uri string)
	Insert(dbname, collname string, records []map[string]any)
	Upsert(dbname, collname, attr string, records []map[string]any) error
	Get(dbname, collname string, spec map[string]any, idx, limit int) []map[string]any
	Update(dbname, collname string, spec, newdata map[string]any)
	Count(dbname, collname string, spec map[string]any) int
	Remove(dbname, collname string, spec map[string]any) error
	Distinct(dbname, collname, field string) ([]any, error)
	InsertRecord(dbname, collname string, rec map[string]any) error
	GetSorted(dbname, collname string, spec map[string]any, skeys []string, sortOrder, idx, limit int) []map[string]any
}

DocDB represents generic interface for document-oriented database

func InitializeDocDB added in v0.5.9

func InitializeDocDB(uri string) (DocDB, error)

InitializeDocDB initializes either mongo or embed database based on server configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL