Documentation
¶
Index ¶
- type MongoDB
- func (db *MongoDB) CommitTrx() error
- func (db *MongoDB) CreateIndexes() error
- func (db *MongoDB) CreateOrder(orderId int, customerId int, warehouseId int, districtId int, oCarrierId int, ...) error
- func (db *MongoDB) CreateSchema() error
- func (db *MongoDB) DeleteNewOrder(orderId int, warehouseId int, districtId int) error
- func (db *MongoDB) GetCustomer(customerId int, warehouseId int, districtId int) (*models.Customer, error)
- func (db *MongoDB) GetCustomerById(customerId int, warehouseId int, districtId int) (*models.Customer, error)
- func (db *MongoDB) GetCustomerByName(name string, warehouseId int, districtId int) (*models.Customer, error)
- func (db *MongoDB) GetCustomerIdOrder(orderId int, warehouseId int, districtId int) (int, error)
- func (db *MongoDB) GetDistrict(warehouseId int, districtId int) (*models.District, error)
- func (db *MongoDB) GetItems(itemIds []int) (*[]models.Item, error)
- func (db *MongoDB) GetLastOrder(customerId int, warehouseId int, districtId int) (*models.Order, error)
- func (db *MongoDB) GetNewOrder(warehouseId int, districtId int) (*models.NewOrder, error)
- func (db *MongoDB) GetNextOrderId(warehouseId int, districtId int) (int, error)
- func (db *MongoDB) GetOrderLines(orderId int, warehouseId int, districtId int) (*[]models.OrderLine, error)
- func (db *MongoDB) GetStockCount(orderIdLt int, orderIdGt int, threshold int, warehouseId int, districtId int) (int64, error)
- func (db *MongoDB) GetStockInfo(districtId int, iIds []int, iWids []int, allLocal int) (*[]models.Stock, error)
- func (db *MongoDB) GetWarehouse(warehouseId int) (*models.Warehouse, error)
- func (db *MongoDB) IncrementDistrictOrderId(warehouseId int, districtId int) error
- func (db *MongoDB) InsertBatch(tableName string, d []interface{}) error
- func (db *MongoDB) InsertHistory(warehouseId int, districtId int, date time.Time, amount float64, data string) error
- func (db *MongoDB) InsertOne(tableName string, d interface{}) error
- func (db *MongoDB) RollbackTrx() error
- func (db *MongoDB) StartTrx() error
- func (db *MongoDB) SumOLAmount(orderId int, warehouseId int, districtId int) (float64, error)
- func (db *MongoDB) UpdateCredit(customerId int, warehouseId int, districtId int, balance float64, data string) error
- func (db *MongoDB) UpdateCustomer(customerId int, warehouseId int, districtId int, sumOlTotal float64) error
- func (db *MongoDB) UpdateDistrictBalance(warehouseId int, districtId int, amount float64) error
- func (db *MongoDB) UpdateOrders(orderId int, warehouseId int, districtId int, oCarrierId int, ...) error
- func (db *MongoDB) UpdateStock(stockId int, warehouseId int, quantity int, ytd int, ordercnt int, ...) error
- func (db *MongoDB) UpdateWarehouseBalance(warehouseId int, amount float64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoDB ¶
type MongoDB struct { Client *mongo.Client C *mongo.Database Aggregate bool // contains filtered or unexported fields }
func NewMongoDb ¶
func (*MongoDB) CreateIndexes ¶
func (*MongoDB) CreateOrder ¶
func (*MongoDB) CreateSchema ¶
func (*MongoDB) DeleteNewOrder ¶
func (*MongoDB) GetCustomer ¶
func (*MongoDB) GetCustomerById ¶
func (*MongoDB) GetCustomerByName ¶
func (*MongoDB) GetCustomerIdOrder ¶
GetCId
func (*MongoDB) GetDistrict ¶
func (*MongoDB) GetLastOrder ¶
func (*MongoDB) GetNewOrder ¶
It also deletes new order, as MongoDB can do that findAndModify is set to 0
func (*MongoDB) GetNextOrderId ¶
func (*MongoDB) GetOrderLines ¶
func (*MongoDB) GetStockCount ¶
func (*MongoDB) GetStockInfo ¶
func (*MongoDB) GetWarehouse ¶
func (*MongoDB) IncrementDistrictOrderId ¶
Get District using warehouseId and districtId and return pointer to models.District or error instead.
func (*MongoDB) InsertBatch ¶
func (*MongoDB) InsertHistory ¶
func (*MongoDB) RollbackTrx ¶
func (*MongoDB) SumOLAmount ¶
func (*MongoDB) UpdateCredit ¶
func (*MongoDB) UpdateCustomer ¶
func (*MongoDB) UpdateDistrictBalance ¶
func (*MongoDB) UpdateOrders ¶
func (*MongoDB) UpdateStock ¶
Click to show internal directories.
Click to hide internal directories.