insertopt

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Many

type Many interface {
	ConvertInsertOption() option.InsertOptioner
	// contains filtered or unexported methods
}

Many is options for InsertInsertMany

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, 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 One

type One interface {
	ConvertInsertOption() option.InsertOptioner
	// contains filtered or unexported methods
}

One is options for InsertInsertOne

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, 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 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