Versions in this module Expand all Collapse all v0 v0.0.2 Dec 21, 2023 Changes in this version + const Version + type Error struct + Code int + Msg string v0.0.1 Sep 9, 2023 Changes in this version + func StringToBool(value string) bool + func StringToInt(value string) int + type Collection struct + Index []IndexFactory + Mg *MongoInstance + Name string + func NewCollection(name string, mg *MongoInstance) *Collection + func (c *Collection) CreateIndex() int + func (c *Collection) GetCollection() *mongo.Collection + func (c *Collection) SetIndex(idx []IndexFactory) *Collection + type Document struct + func NewDocument(c *Collection) *Document + func (d *Document) CheckSaved() bool + func (d *Document) CountAll() (int64, int) + func (d *Document) Delete() int + func (d *Document) Get() *mongo.SingleResult + func (d *Document) GetCursor(limit int64) (*mongo.Cursor, int) + func (d *Document) Incr(key string, value string) int + func (d *Document) Paginate(limit, page int64, x any) paginate.PaginationData + func (d *Document) PaginateWithSelect(limit, page int64) paginate.PagingQuery + func (d *Document) Save() int + func (d *Document) SetCollection(c *Collection) *Document + func (d *Document) SetData(a any) *Document + func (d *Document) SetFields(f primitive.D) *Document + func (d *Document) SetFilter(f primitive.D) *Document + func (d *Document) SetUpdate(a primitive.D) *Document + func (d *Document) Update() int + type ErrorCode int + const CONNECT + const COUNT + const DEFAULT + const DELETE + const GET_CURSOR + const INDEX_CREATE + const PAGINATE + const SAVE + const UPDATE + type IndexFactory struct + T IndexType + Values map[string]string + func (x *IndexFactory) CreateIndex(c *Collection) int + type IndexText struct + func (x *IndexText) Set() + type IndexType int + const IdxTEXT + const IdxUNIQUE + type IndexUnique struct + func (x *IndexUnique) Set() + type KV struct + Key string + Value string + type MongoInstance struct + BaseUrl string + Client *mongo.Client + Collections *int + Connected bool + Context context.Context + Db *mongo.Database + DbName string + Uri string + func NewMongoInstance(dbName, baseUrl string) *MongoInstance + func (mg *MongoInstance) Connect() int + func (mg *MongoInstance) GetCollection(value string) *mongo.Collection + func (mg *MongoInstance) ListDatabaseNames() int + func (mg *MongoInstance) SetBaseUrl(value string) *MongoInstance + func (mg *MongoInstance) SetCollection(c *Collection) *MongoInstance + func (mg *MongoInstance) SetDbName(value string) *MongoInstance + func (mg *MongoInstance) SetUri() *MongoInstance + type QType int + const QFilter + const QInc + const QSearch + const QSet + type Query struct + Data primitive.D + Kv KV + QType QType + func (q *Query) Get() primitive.D