Versions in this module Expand all Collapse all v1 v1.4.13 Apr 17, 2023 v1.4.12 Apr 7, 2023 v1.4.11 Apr 7, 2023 v1.4.10 Apr 5, 2023 Changes in this version + func Connect(ctx context.Context) *mongo.Client + func Disconnect(ctx context.Context) v1.3.9 Apr 5, 2023 v1.3.8 Apr 5, 2023 Changes in this version + func Setup(db, host, port, password string) v1.2.8 Dec 10, 2022 Changes in this version + type Eloquent struct + Collection string + func NewEloquent(collection string) *Eloquent[T] + func (e *Eloquent[T]) All(opts ...*options.FindOptions) (models []*T, err error) + func (e *Eloquent[T]) Close(client *mongo.Client) + func (e *Eloquent[T]) Connect() (client *mongo.Client) + func (e *Eloquent[T]) Count(filter any) (count int, err error) + func (e *Eloquent[T]) Delete(id string) (deleteCount int, err error) + func (e *Eloquent[T]) DeleteMultiple(filter any) (deleteCount int, err error) + func (e *Eloquent[T]) Find(id string) (model *T, err error) + func (e *Eloquent[T]) FindMultiple(filter any, opts ...*options.FindOptions) (models []*T, err error) + func (e *Eloquent[T]) GetCollection(client *mongo.Client) *mongo.Collection + func (e *Eloquent[T]) Insert(data *T) (insertedID string, err error) + func (e *Eloquent[T]) InsertMultiple(data []*T) (InsertedIDs []string, err error) + func (e *Eloquent[T]) Paginate(limit int, page int, filter any) (paginated *Pagination[T], err error) + func (e *Eloquent[T]) Update(id string, data *T) (modifiedCount int, err error) + func (e *Eloquent[T]) UpdateMultiple(filter any, data *T) (modifiedCount int, err error) + type IEloquent interface + All func(opts ...*options.FindOptions) (models []*T, err error) + Close func(client *mongo.Client) + Connect func() (client *mongo.Client) + Count func(filter any) (count int, err error) + Delete func(id string) (deleteCount int, err error) + DeleteMultiple func(filter any) (deleteCount int, err error) + Find func(id string) (model *T, err error) + FindMultiple func(filter any, opts ...*options.FindOptions) (models []*T, err error) + GetCollection func(client *mongo.Client) *mongo.Collection + Insert func(data *T) (insertedID string, err error) + InsertMultiple func(data []*T) (InsertedIDs []string, err error) + Paginate func(limit int, page int, filter any) (paginated *Pagination[T], err error) + Update func(id string, data *T) (modifiedCount int, err error) + UpdateMultiple func(filter any, data *T) (modifiedCount int, err error) + type Pagination struct + CurrentPage int + Data []*T + From int + LastPage int + PerPage int + To int + Total int v1.1.8 Nov 26, 2022 v1.1.7 Nov 25, 2022 v1.1.6 Nov 25, 2022 v1.1.5 Nov 25, 2022