docdb

package
v0.5.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Count

func Count(dbname, collname string, spec map[string]any) int

Count gets number records from document-oriented db

func Distinct added in v0.5.2

func Distinct(dbname, collname, field string) ([]any, error)

Distinct gets number records from document-oriented db

func Get

func Get(dbname, collname string, spec map[string]any, idx, limit int) []map[string]any

Get records from document-oriented db

func GetSorted added in v0.5.2

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 InitDocDB

func InitDocDB(uri string)

InitDocDB initializes document-oriented db connection object

func InsertRecord added in v0.5.2

func InsertRecord(dbname, collname string, rec map[string]any) error

InsertRecord insert record with given spec to document-oriented db

func Remove

func Remove(dbname, collname string, spec map[string]any) error

Remove records from document-oriented db

func Update

func Update(dbname, collname string, spec, newdata map[string]any)

Update inplace for given spec

func Upsert

func Upsert(dbname, collname, attr string, records []map[string]any) error

Upsert records into document-oriented db

Types

This section is empty.

Jump to

Keyboard shortcuts

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