module

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2025 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MongoInfo = atdb.DBInfo{
	DBString: MongoString,
	DBName:   "tb2024",
}
View Source
var MongoString string = os.Getenv("MONGOSTRING")

Functions

func DeleteGadgetID

func DeleteGadgetID(_id primitive.ObjectID, db *mongo.Database, col string) error

func GetDataGadget

func GetDataGadget(db *mongo.Database, col string) (data []model.Gadget)

func GetDataReview

func GetDataReview(db *mongo.Database, col string) (data []model.Review)

func GetGadgetByID added in v0.0.3

func GetGadgetByID(_id primitive.ObjectID, db *mongo.Database, col string) (gadgets model.Gadget, errs error)

func InsertGadget

func InsertGadget(db *mongo.Database, col string, nama string, merk string, harga float64, spesifikasi model.Spesifikasi, deskripsi string) (insertedID primitive.ObjectID, err error)

func InsertOneDoc

func InsertOneDoc(db string, collection string, doc interface{}) (insertedID interface{})

func InsertReview

func InsertReview(db *mongo.Database, col string, rating int, review string) (insertedID primitive.ObjectID, err error)

func MongoConnect

func MongoConnect(dbname string) (db *mongo.Database)

func UpdateGadget

func UpdateGadget(db *mongo.Database, col string, id primitive.ObjectID, nama string, merk string, harga float64, spesifikasi model.Spesifikasi, deskripsi string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL