Versions in this module Expand all Collapse all v1 v1.2.1 Jul 1, 2023 Changes in this version + const MODEL1 + const MODEL2 + const MODEL3 + func Bucket(table string) (bucket *gridfs.Bucket, err error) + func DB() *mongo.Database + func DelMany(ctx context.Context, table string, filter bson.D, deletedBy int64) (err error) + func DownloadFile(table, fid string) (data []byte, err error) + func GetNextInt64(ctx context.Context, table string) (nextInt int64, err error) + func InitDatabase(ctx context.Context, c Conf) (err error) + func LoadEnvConf(c *Conf, must bool) + func PageQuery(ctx context.Context, table string, filter bson.D, page *model.Page, res any, ...) (total int64, err error) + func Query(ctx context.Context, table string, filter bson.D, res any, ...) error + func QueryOne(ctx context.Context, table string, filter bson.D, res any, ...) error + func StructureBsonD(arg any, model int) bson.D + func ToObjectIDS(strs []string) (ids []primitive.ObjectID) + func UploadFile(table string, data []byte) (fid string, err error) + func UpsertMany(ctx context.Context, table string, filters []bson.D, updates any, upsert bool) (res *mongo.BulkWriteResult, err error) + func UpsertOne(ctx context.Context, table string, filter bson.D, update any, upsert bool) (*mongo.UpdateResult, error) + type BaseModel struct + CreatedAt int64 + CreatedBy int64 + ID primitive.ObjectID + IsDeleted int8 + UpdatedAt int64 + UpdatedBy int64 + func CreateBaseModel(uid int64) BaseModel + func (b *BaseModel) Update(uid int64) + type Conf struct + DB string + MaxPoolSize int64 + MaxTimeout int64 + URI string v1.2.0 Apr 25, 2023 Changes in this version + func ToObjectIDs(strs []string) (ids []primitive.ObjectID)