mongodb

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aggregate added in v0.0.2

func Aggregate(data AggregateData, destination any) error

Aggregate method

func Connect

func Connect(config *Config) error

Connect method

func Context

func Context(timeout int64) (context.Context, context.CancelFunc)

Context method

func Count added in v0.0.2

func Count(data CountData) (int64, error)

Count method

func Disconnect added in v0.0.16

func Disconnect() error

Disconnect method

func Distinct added in v0.0.6

func Distinct(data DistinctData) ([]any, error)

Distinct method

func DropIndexes added in v0.0.15

func DropIndexes(data []IndexData) error

DropIndexes method

func EnsureIndexes added in v0.0.14

func EnsureIndexes(data []IndexData) error

EnsureIndexes method

func Find

func Find(data FindData, destination any) error

Find method

func FindOne added in v0.0.11

func FindOne(data FindOneData, destination Document) error

FindOne method

func FindOneBy added in v0.0.11

func FindOneBy(data FindOneByData, destination Document) error

FindOneBy method

func ListIndexes added in v0.0.15

func ListIndexes(data ListIndexesData, destination any) error

ListIndexes method

Types

type AggregateData added in v0.0.6

type AggregateData struct {
	Collection string
	Pipeline   Pipeline
	Options    *AggregateOptions
}

AggregateData struct

type AggregateOptions added in v0.0.2

type AggregateOptions = options.AggregateOptions

AggregateOptions struct

type Array

type Array = bson.D

Array struct

type Binary added in v0.0.6

type Binary = primitive.Binary

Binary struct

type Client

type Client = mongo.Client

Client struct

func GetClient

func GetClient() *Client

GetClient method

type Collation

type Collation = options.Collation

Collation struct

type Collection

type Collection = mongo.Collection

Collection struct

func GetCollection

func GetCollection(name string) *Collection

GetCollection method

type Config

type Config struct {
	URI                   string
	Database              string
	OperationTimeout      int64
	MassOperationTimeout  int64
	IndexOperationTimeout int64
}

Config struct

type CountData added in v0.0.6

type CountData struct {
	Collection string
	Filters    *Array
	Options    *CountOptions
}

CountData struct

type CountOptions added in v0.0.2

type CountOptions = options.CountOptions

CountOptions struct

type CursorType added in v0.0.6

type CursorType = options.CursorType

CursorType struct

type Database

type Database = mongo.Database

Database struct

func GetDatabase

func GetDatabase() *Database

GetDatabase method

type DateTime added in v0.0.6

type DateTime = primitive.DateTime

DateTime struct

type Decimal128 added in v0.0.6

type Decimal128 = primitive.Decimal128

Decimal128 struct

type DeleteData added in v0.0.11

type DeleteData struct {
	Collection string
	Filters    *Array
	Options    *DeleteOptions
}

DeleteData struct

type DeleteManyData added in v0.0.6

type DeleteManyData struct {
	Collection string
	Filters    *Array
	Options    *DeleteManyOptions
}

DeleteManyData struct

type DeleteManyOptions added in v0.0.6

type DeleteManyOptions = options.DeleteOptions

DeleteManyOptions struct

type DeleteManyResult added in v0.0.6

type DeleteManyResult = mongo.DeleteResult

DeleteManyResult struct

func DeleteMany added in v0.0.6

func DeleteMany(data DeleteManyData) (*DeleteManyResult, error)

DeleteMany method

type DeleteOptions added in v0.0.11

type DeleteOptions = options.DeleteOptions

DeleteOptions struct

type DeleteResult

type DeleteResult = mongo.DeleteResult

DeleteResult struct

func Delete

func Delete(data DeleteData) (*DeleteResult, error)

Delete method

type DistinctData added in v0.0.6

type DistinctData struct {
	Collection string
	Field      string
	Filters    *Array
	Options    *DistinctOptions
}

DistinctData struct

type DistinctOptions added in v0.0.6

type DistinctOptions = options.DistinctOptions

DistinctOptions struct

type Document

type Document = any

Document struct

type FindData added in v0.0.6

type FindData struct {
	Collection string
	Filters    *Array
	Options    *FindOptions
}

FindData struct

type FindOneByData added in v0.0.11

type FindOneByData struct {
	Collection string
	Key        string
	Value      string
	Options    *FindOneOptions
}

FindOneByData struct

type FindOneData added in v0.0.11

type FindOneData struct {
	Collection string
	Filters    *Array
	Options    *FindOneOptions
}

FindOneData struct

type FindOneOptions added in v0.0.11

type FindOneOptions = options.FindOneOptions

FindOneOptions struct

type FindOptions added in v0.0.6

type FindOptions = options.FindOptions

FindOptions struct

type IndexData added in v0.0.14

type IndexData struct {
	Collection string
	Name       string
	Keys       Document
	Options    *IndexOptions
}

IndexData struct

type IndexOptions added in v0.0.14

type IndexOptions = options.IndexOptions

IndexOptions struct

type InsertData added in v0.0.11

type InsertData struct {
	Collection string
	Document   Document
	Options    *InsertOptions
}

InsertData struct

type InsertManyData added in v0.0.11

type InsertManyData struct {
	Collection string
	Documents  []Document
	Options    *InsertManyOptions
}

InsertManyData struct

type InsertManyOptions added in v0.0.11

type InsertManyOptions = options.InsertManyOptions

InsertManyOptions struct

type InsertManyResult added in v0.0.11

type InsertManyResult = mongo.InsertManyResult

InsertManyResult struct

func InsertMany added in v0.0.11

func InsertMany(data InsertManyData) (*InsertManyResult, error)

InsertMany method

type InsertOptions added in v0.0.11

type InsertOptions = options.InsertOneOptions

InsertOptions struct

type InsertResult

type InsertResult = mongo.InsertOneResult

InsertResult struct

func Insert added in v0.0.11

func Insert(data InsertData) (*InsertResult, error)

Insert method

type Item

type Item = bson.E

Item struct

type JavaScript added in v0.0.6

type JavaScript = primitive.JavaScript

JavaScript struct

type List added in v0.0.5

type List = bson.A

List struct

type ListIndexesData added in v0.0.15

type ListIndexesData struct {
	Collection string
}

ListIndexesData struct

type Map

type Map = bson.M

Map struct

type MaxKey added in v0.0.6

type MaxKey = primitive.MaxKey

MaxKey struct

type MinKey added in v0.0.6

type MinKey = primitive.MinKey

MinKey struct

type Null added in v0.0.6

type Null = primitive.Null

Null struct

type ObjectID added in v0.0.6

type ObjectID = primitive.ObjectID

ObjectID struct

type Pipeline added in v0.0.4

type Pipeline = []Array

Pipeline struct

type Regex

type Regex = primitive.Regex

Regex struct

type Timestamp added in v0.0.6

type Timestamp = primitive.Timestamp

Timestamp struct

type UpdateData added in v0.0.11

type UpdateData struct {
	Collection string
	Filters    *Array
	Updates    Document
	Options    *UpdateOptions
}

UpdateData struct

type UpdateManyData added in v0.0.6

type UpdateManyData struct {
	Collection string
	Filters    *Array
	Updates    Document
	Options    *UpdateManyOptions
}

UpdateManyData struct

type UpdateManyOptions added in v0.0.6

type UpdateManyOptions = options.UpdateOptions

UpdateManyOptions struct

type UpdateManyResult added in v0.0.6

type UpdateManyResult = mongo.UpdateResult

UpdateManyResult struct

func UpdateMany added in v0.0.6

func UpdateMany(data UpdateManyData) (*UpdateManyResult, error)

UpdateMany method

type UpdateOptions added in v0.0.11

type UpdateOptions = options.UpdateOptions

UpdateOptions struct

type UpdateResult

type UpdateResult = mongo.UpdateResult

UpdateOneResult struct

func Update

func Update(data UpdateData) (*UpdateResult, error)

Update method

Jump to

Keyboard shortcuts

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