internal

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultCondition

func DefaultCondition() driver.Condition

DefaultCondition returns a default condition initialized with an empty bson.D slice. This condition can be used to chain query filter methods and construct complex filter expressions

func NewAggregate

func NewAggregate(engine driver.Client) driver.Aggregate

NewAggregate creates a new instance of the Aggregate struct with the provided client as the engine.

func NewClient

func NewClient(db string, opts ...*options.ClientOptions) (driver.Client, error)

NewClient creates a new client with the specified database name and options. It returns a driver.Client interface and an error.

func NewIndexes

func NewIndexes(driver driver.Client) driver.Indexes

func NewSession

func NewSession(engine driver.Client) driver.Session

NewSession creates a new session with the specified engine and default condition filter. It returns a driver.Session interface which can be used to interact with the engine.

Types

type ClientOptions

type ClientOptions interface {
	// SetArrayFilters sets the value for the ArrayFilters field.
	SetArrayFilters(filters options.ArrayFilters) driver.Session
	// SetOrdered sets the value for the Ordered field.
	SetOrdered(ordered bool) driver.Session
	// SetBypassDocumentValidation sets the value for the BypassDocumentValidation field.
	SetBypassDocumentValidation(b bool) driver.Session
	// SetReturnDocument sets the value for the ReturnDocument field.
	SetReturnDocument(rd options.ReturnDocument) driver.Session

	// SetUpsert sets the value for the Upsert field.
	SetUpsert(b bool) driver.Session

	// SetCollation sets the value for the Collation field.
	SetCollation(collation *options.Collation) driver.Session

	// SetMaxTime sets the value for the MaxTime field.
	SetMaxTime(d time.Duration) driver.Session
	// SetProjection sets the value for the Projection field.
	SetProjection(projection interface{}) driver.Session

	// SetSort sets the value for the Sort field.
	SetSort(sort interface{}) driver.Session

	// SetHint sets the value for the Hint field.
	SetHint(hint interface{}) driver.Session
}

ClientOptions represents the options for configuring a client session.

type Options

type Options struct {
	UpdateEmpty bool
}

func (*Options) SetUpdateEmpty

func (o *Options) SetUpdateEmpty(e bool)

SetUpdateEmpty sets the value for the UpdateEmpty field.

Jump to

Keyboard shortcuts

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