mongodb

package
v4.0.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Driver = "mongodb"

Variables

This section is empty.

Functions

func BleveQueryToMongoFilters

func BleveQueryToMongoFilters(queryString string, insensitive bool, fieldTransformer func(string) string) (filters []bson.E, err error)

BleveQueryToMongoFilters parses a Blevesearch query string to a slice of bson primitives

func NewDAO

func NewDAO(driver string, dsn string, prefix string) (dao.DAO, error)

NewDAO creates a new handler for the boltdb dao

func NewIndexer

func NewIndexer(dao dao.DAO) (dao.IndexDAO, error)

Types

type Collation

type Collation struct {
	Locale   string
	Strength int
}

type Collection

type Collection struct {
	Name             string
	DefaultCollation Collation
	Indexes          []map[string]int
	IDName           string
}

type DAO

type DAO interface {
	dao.DAO
	DB() *mongo.Database
}

DAO defines the functions specific to the boltdb dao

type Handler

type Handler struct {
	dao.DAO
}

Handler for the main functions of the DAO

func (*Handler) DB

func (h *Handler) DB() *mongo.Database

DB returns the bolt DB object

func (*Handler) Init

func (h *Handler) Init(cfg configx.Values) error

Init initialises the handler

type IndexDAO

type IndexDAO interface {
	DAO
	dao.IndexDAO
	SetCollection(string)
}

type Indexer

type Indexer struct {
	DAO
	// contains filtered or unexported fields
}

func (*Indexer) Close

func (i *Indexer) Close() error

func (*Indexer) DeleteMany

func (i *Indexer) DeleteMany(ctx context.Context, query interface{}) (int32, error)

func (*Indexer) DeleteOne

func (i *Indexer) DeleteOne(ctx context.Context, data interface{}) error

func (*Indexer) FindMany

func (i *Indexer) FindMany(ctx context.Context, query interface{}, offset, limit int32, customCodec dao.IndexCodex) (chan interface{}, error)

func (*Indexer) Flush

func (i *Indexer) Flush(ctx context.Context) error

func (*Indexer) Init

func (i *Indexer) Init(cfg configx.Values) error

func (*Indexer) InsertOne

func (i *Indexer) InsertOne(ctx context.Context, data interface{}) error

func (*Indexer) Resync

func (i *Indexer) Resync(ctx context.Context, logger func(string)) error

func (*Indexer) SetCodex

func (i *Indexer) SetCodex(c dao.IndexCodex)

func (*Indexer) SetCollection

func (i *Indexer) SetCollection(c string)

func (*Indexer) Truncate

func (i *Indexer) Truncate(ctx context.Context, max int64, logger func(string)) error

type Model

type Model struct {
	Collections []Collection
}

func (Model) Init

func (m Model) Init(ctx context.Context, db *mongo.Database) error

Jump to

Keyboard shortcuts

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