Documentation ¶
Overview ¶
Package db implements database operations for the haul server.
The database used is mongodb.
Index ¶
- func CreateAssemblies(assemblies types.Assemblies) (*mongo.InsertManyResult, error)
- func CreateAssembly(assembly types.Assembly) (*mongo.InsertOneResult, error)
- func CreateComponent(component types.Component) (*mongo.InsertOneResult, error)
- func CreateComponents(components types.Components) (*mongo.InsertManyResult, error)
- func CreateKit(kit types.Kit) (*mongo.InsertOneResult, error)
- func CreateKits(kits types.Kits) (*mongo.InsertManyResult, error)
- func DeleteFromID(collection string, id primitive.ObjectID) (*mongo.DeleteResult, error)
- func Ping(uri string) (bson.M, error)
- func ReadAll(collection string) ([]*bson.M, error)
- func ReadFromID(collection string, id primitive.ObjectID) (bson.M, error)
- func UpdateFromID(collection string, id primitive.ObjectID, data bson.D) (*mongo.UpdateResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAssemblies ¶ added in v0.25.1
func CreateAssemblies(assemblies types.Assemblies) (*mongo.InsertManyResult, error)
func CreateAssembly ¶ added in v0.10.1
func CreateAssembly(assembly types.Assembly) (*mongo.InsertOneResult, error)
func CreateComponent ¶ added in v0.9.1
func CreateComponent(component types.Component) (*mongo.InsertOneResult, error)
func CreateComponents ¶ added in v0.25.1
func CreateComponents(components types.Components) (*mongo.InsertManyResult, error)
func CreateKits ¶ added in v0.25.1
func CreateKits(kits types.Kits) (*mongo.InsertManyResult, error)
func DeleteFromID ¶
func UpdateFromID ¶ added in v0.9.1
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.