db

package
v0.26.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package db implements database operations for the haul server.

The database used is mongodb.

Index

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 CreateKit added in v0.10.1

func CreateKit(kit types.Kit) (*mongo.InsertOneResult, error)

func CreateKits added in v0.25.1

func CreateKits(kits types.Kits) (*mongo.InsertManyResult, error)

func DeleteFromID

func DeleteFromID(collection string, id primitive.ObjectID) (*mongo.DeleteResult, error)

func Ping

func Ping(uri string) (bson.M, error)

func ReadAll

func ReadAll(collection string) ([]*bson.M, error)

func ReadFromID

func ReadFromID(collection string, id primitive.ObjectID) (bson.M, error)

func UpdateFromID added in v0.9.1

func UpdateFromID(collection string, id primitive.ObjectID, data bson.D) (*mongo.UpdateResult, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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