Versions in this module Expand all Collapse all v0 v0.0.2 Jul 14, 2024 Changes in this version type Mongo + func (m *Mongo) PaginateWithSort(name string, filter primitive.D, sortField string, sortValue int, ...) (paginate.PaginationData, Error) type Schema + func (s *Schema) PaginateWithSort(filter primitive.D, sortField string, sortValue int, limit, page int64, x any) mongopagination.PaginationData v0.0.1 Jul 7, 2024 Changes in this version + const CONNECT + const COUNT + const DEFAULT + const DELETE + const GET_CURSOR + const INDEX_CREATE + const PAGINATE + const SAVE + const UPDATE + var ConfigDefault = Config + func IndexText(key string, weight int) mongo.IndexModel + func IndexUnique(key string, value bool) mongo.IndexModel + func StringToBool(value string) bool + func StringToInt(value string) int + type Config struct + ConnectionURI string + Database string + Host string + Password string + Port int + Username string + type Error struct + Code int + Msg string + type Log struct + Expiration time.Time + Key string + ObjectID primitive.ObjectID + Value []byte + type Logger struct + Storage *mongodb.Storage + func LoggerSettings(mongo_uri string) *Logger + func (log *Logger) Set(key, value string) + type Mongo struct + func New(config ...Config) *Mongo + func (m *Mongo) CheckSaved(name string, filter primitive.D) bool + func (m *Mongo) Collection(name string) *mongo.Collection + func (m *Mongo) Connected() bool + func (m *Mongo) CreateIndex(name string, indexModel mongo.IndexModel) Error + func (m *Mongo) Delete(name string, filter primitive.D) Error + func (m *Mongo) Get(name string, filter primitive.D, opts *options.FindOneOptions) *mongo.SingleResult + func (m *Mongo) GetURI() string + func (m *Mongo) Incr(name, key, value string, filter primitive.D) Error + func (m *Mongo) Paginate(name string, filter primitive.D, limit, page int64, x any) (paginate.PaginationData, Error) + func (m *Mongo) Save(name string, data any) Error + func (m *Mongo) Update(name string, filter primitive.D, data primitive.D) Error + type Schema struct + FilterID primitive.D + IndexModels []mongo.IndexModel + Mongo *Mongo + Name string + func NewSchema(name string) *Schema + func (s *Schema) CheckSaved() bool + func (s *Schema) CreateIndex() + func (s *Schema) Delete() map[string]any + func (s *Schema) Incr(key, value string) map[string]any + func (s *Schema) Paginate(filter primitive.D, limit, page int64, x any) mongopagination.PaginationData + func (s *Schema) Save(data any) map[string]any + func (s *Schema) SetFilterID(filter primitive.D) *Schema + func (s *Schema) SetIndex(idx mongo.IndexModel) *Schema + func (s *Schema) SetMongo(m *Mongo) *Schema + func (s *Schema) Update(data primitive.D) map[string]any