Versions in this module Expand all Collapse all v0 v0.0.0 Dec 15, 2023 Changes in this version + const DBError + const DBErrorName + const ParserError + const ParserErrorName + const QueryError + const QueryErrorName + const ServerError + const ServerErrorName + const ValidationError + const ValidationErrorName + func Count(dbname, collname string, spec bson.M) int + func GetInt64Value(rec Record, key string) (int64, error) + func GetIntValue(rec Record, key string) (int, error) + func GetSingleStringValue(rec Record, key string) (string, error) + func GetStringValue(rec Record, key string) (string, error) + func GetValue(rec Record, key string) interface + func InitMongoDB(uri string) + func Insert(dbname, collname string, records []Record) + func MapKeys(rec Record) []string + func Remove(dbname, collname string, spec bson.M) + func Update(dbname, collname string, spec, newdata bson.M) + func Upsert(dbname, collname, attr string, records []Record) error + type Connection struct + Client *mongo.Client + URI string + var Mongo Connection + func (m *Connection) Connect() *mongo.Client + type Record map[string]interface + func (r Record) ToJSON() string + func (r Record) ToString() string + func ErrorRecord(msg, etype string, ecode int) Record + func Get(dbname, collname string, spec bson.M, idx, limit int) []Record + func GetSorted(dbname, collname string, spec bson.M, skeys []string) []Record