insertopt

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InsertSessionOpt added in v0.0.10

type InsertSessionOpt struct{}

InsertSessionOpt is a one,many session option.

func (InsertSessionOpt) ConvertInsertSession added in v0.0.10

func (opt InsertSessionOpt) ConvertInsertSession() *session.Client

ConvertInsertSession implements the InsertSession interface.

type Many

type Many interface {
	// contains filtered or unexported methods
}

Many represents all passable params for the insertMany() function.

type ManyBundle

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

ManyBundle is a bundle of InsertInsertMany options

func BundleMany

func BundleMany(opts ...Many) *ManyBundle

BundleMany bundles Many options

func (*ManyBundle) BypassDocumentValidation

func (mb *ManyBundle) BypassDocumentValidation(b bool) *ManyBundle

BypassDocumentValidation adds an option allowing the write to opt-out of the document-level validation.

func (*ManyBundle) ConvertInsertOption

func (mb *ManyBundle) ConvertInsertOption() option.InsertOptioner

ConvertInsertOption implements the Many interface

func (*ManyBundle) Ordered

func (mb *ManyBundle) Ordered(b bool) *ManyBundle

Ordered adds an option that if true and insert fails, returns without performing remaining writes, otherwise continues

func (*ManyBundle) String

func (mb *ManyBundle) String() string

String implements the Stringer interface

func (*ManyBundle) Unbundle

func (mb *ManyBundle) Unbundle(deduplicate bool) ([]option.InsertOptioner, *session.Client, error)

Unbundle unwinds and deduplicates the options used to create it and those added after creation into a single slice of options.

The deduplicate parameter is used to determine if the bundle is just flattened or if we actually deduplicate options.

Since a bundle can be recursive, this method will unwind all recursive bundles.

type ManyOption added in v0.0.10

type ManyOption interface {
	Many
	ConvertInsertOption() option.InsertOptioner
}

ManyOption represents the options for the insertMany() function.

type ManySession added in v0.0.10

type ManySession interface {
	Many
	ConvertInsertSession() *session.Client
}

ManySession is the session for the insertMany() function

type One

type One interface {
	// contains filtered or unexported methods
}

One represents all passable params for the insertOne() function.

type OneBundle

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

OneBundle is a bundle of One options

func BundleOne

func BundleOne(opts ...One) *OneBundle

BundleOne bundles One options

func (*OneBundle) BypassDocumentValidation

func (ob *OneBundle) BypassDocumentValidation(b bool) *OneBundle

BypassDocumentValidation adds an option allowing the write to opt-out of the document-level validation.

func (*OneBundle) ConvertInsertOption

func (ob *OneBundle) ConvertInsertOption() option.InsertOptioner

ConvertInsertOption implements the One interface

func (*OneBundle) String

func (ob *OneBundle) String() string

String implements the Stringer interface

func (*OneBundle) Unbundle

func (ob *OneBundle) Unbundle(deduplicate bool) ([]option.InsertOptioner, *session.Client, error)

Unbundle unwinds and deduplicates the options used to create it and those added after creation into a single slice of options.

The deduplicate parameter is used to determine if the bundle is just flattened or if we actually deduplicate options.

Since a bundle can be recursive, this method will unwind all recursive bundles.

type OneOption added in v0.0.10

type OneOption interface {
	One
	ConvertInsertOption() option.InsertOptioner
}

OneOption represents the options for the insertOne() function.

type OneSession added in v0.0.10

type OneSession interface {
	One
	ConvertInsertSession() *session.Client
}

OneSession is the session for the insertOne() function

type OptBypassDocumentValidation

type OptBypassDocumentValidation option.OptBypassDocumentValidation

OptBypassDocumentValidation allows the write to opt-out of the document-level validation.

func BypassDocumentValidation

func BypassDocumentValidation(b bool) OptBypassDocumentValidation

BypassDocumentValidation allows the write to opt-out of the document-level validation.

func (OptBypassDocumentValidation) ConvertInsertOption

func (opt OptBypassDocumentValidation) ConvertInsertOption() option.InsertOptioner

ConvertInsertOption implements the One,Many interface

type OptOrdered

type OptOrdered option.OptOrdered

OptOrdered if true and insert fails, returns without performing remaining writes, otherwise continues

func Ordered

func Ordered(b bool) OptOrdered

Ordered if true and insert fails, returns without performing remaining writes, otherwise continues

func (OptOrdered) ConvertInsertOption

func (opt OptOrdered) ConvertInsertOption() option.InsertOptioner

ConvertInsertOption implements the Many interface

Jump to

Keyboard shortcuts

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