mongodb

package
v0.9.2-1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(dbURI, dbName string) (ytlibrarian.Thinger, error)

Types

type MongoDBThinger

type MongoDBThinger struct {
	// contains filtered or unexported fields
}

func (*MongoDBThinger) AddThing

func (m *MongoDBThinger) AddThing(t ytlibrarian.Thing) error

func (*MongoDBThinger) BreakRelationship

func (m *MongoDBThinger) BreakRelationship(parentID, childID string) error

BreakRelationship removes a relational entry between two Things

func (*MongoDBThinger) Close

func (m *MongoDBThinger) Close() error

Close closes the MongoDB client

func (*MongoDBThinger) GetAllThings

func (m *MongoDBThinger) GetAllThings() ([]ytlibrarian.Thing, error)

func (*MongoDBThinger) GetAllThingsByType

func (m *MongoDBThinger) GetAllThingsByType(thingType string) ([]ytlibrarian.Thing, error)

func (*MongoDBThinger) GetChildren

func (m *MongoDBThinger) GetChildren(parentID string) ([]ytlibrarian.Thing, error)

GetChildren returns IDs of all Things which are children of the identified Thing

func (*MongoDBThinger) GetParents

func (m *MongoDBThinger) GetParents(childID string) ([]ytlibrarian.Thing, error)

GetParents returns IDs of all Things which are parents of the identified Thing

func (*MongoDBThinger) GetRelationshipData

func (m *MongoDBThinger) GetRelationshipData(parentID, childID string) (string, error)

GetRelationshipData retrieves the data associated with the matching parent/child relationships

func (*MongoDBThinger) GetThing

func (m *MongoDBThinger) GetThing(id string) (ytlibrarian.Thing, error)

func (*MongoDBThinger) GetThingByReferenceID

func (m *MongoDBThinger) GetThingByReferenceID(referenceID string) (ytlibrarian.Thing, error)

func (*MongoDBThinger) GetThingsByReferenceIDs

func (m *MongoDBThinger) GetThingsByReferenceIDs(ids []string) ([]ytlibrarian.Thing, error)

func (*MongoDBThinger) MakeRelationship

func (m *MongoDBThinger) MakeRelationship(parentID, childID, data string) error

MakeRelationship creates a relational entry between two Things

func (*MongoDBThinger) RemoveThing

func (m *MongoDBThinger) RemoveThing(id string) error

func (*MongoDBThinger) UpdateRelationshipData

func (m *MongoDBThinger) UpdateRelationshipData(parentID, childID, data string) error

UpdateRelationshipData updates the data associated with the matching parent/child relationships

func (*MongoDBThinger) UpdateThing

func (m *MongoDBThinger) UpdateThing(t ytlibrarian.Thing) error

Jump to

Keyboard shortcuts

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