mongo

package
v0.0.0-...-367ce81 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoDocuments = mongo.ErrNoDocuments

Functions

This section is empty.

Types

type CollectionName

type CollectionName string
var (
	CollectionNameSystem       CollectionName = "system"
	CollectionNameAuditLogs    CollectionName = "audit_logs"
	CollectionNameEmotes       CollectionName = "emotes"
	CollectionNameEmoteSets    CollectionName = "emote_sets"
	CollectionNameUsers        CollectionName = "users"
	CollectionNameRoles        CollectionName = "roles"
	CollectionNameEntitlements CollectionName = "entitlements"
	CollectionNameCosmetics    CollectionName = "cosmetics"
	CollectionNameReports      CollectionName = "reports"
	CollectionNameBans         CollectionName = "bans"
	CollectionNameMessages     CollectionName = "messages"
	CollectionNameMessagesRead CollectionName = "messages_read"
)

type DeleteOneModel

type DeleteOneModel = mongo.DeleteOneModel

type IndexModel

type IndexModel = mongo.IndexModel

type InsertOneModel

type InsertOneModel = mongo.InsertOneModel

type Instance

type Instance interface {
	Collection(CollectionName) *mongo.Collection
	ExternalCollection(db string, name CollectionName) *mongo.Collection
	Ping(ctx context.Context) error
	RawClient() *mongo.Client
	RawDatabase() *mongo.Database
	System(ctx context.Context) (structures.System, error)
}

func Setup

func Setup(ctx context.Context, opt SetupOptions) (Instance, error)

type Lookup

type Lookup struct {
	From         CollectionName `bson:"from"`
	LocalField   string         `bson:"localField"`
	ForeignField string         `bson:"foreignField"`
	As           string         `bson:"as"`
}

type LookupWithPipeline

type LookupWithPipeline struct {
	From     CollectionName  `bson:"from"`
	Let      bson.M          `bson:"let"`
	Pipeline *mongo.Pipeline `bson:"pipeline"`
	As       string          `bson:"as"`
}

type Pipeline

type Pipeline = mongo.Pipeline

type SetupOptions

type SetupOptions struct {
	URI    string
	DB     string
	Direct bool
}

type UpdateOneModel

type UpdateOneModel = mongo.UpdateOneModel

type WriteModel

type WriteModel = mongo.WriteModel

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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