findopt

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteOne

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

DeleteOne represents all passable params for the deleteOne() function.

type DeleteOneBundle

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

DeleteOneBundle is a bundle of FindOneAndDelete options

func BundleDeleteOne

func BundleDeleteOne(opts ...DeleteOne) *DeleteOneBundle

BundleDeleteOne bundles FindOneAndDelete options

func (*DeleteOneBundle) Collation

func (dob *DeleteOneBundle) Collation(collation *mongoopt.Collation) *DeleteOneBundle

Collation adds an option to specify a Collation

func (*DeleteOneBundle) ConvertDeleteOneOption

func (dob *DeleteOneBundle) ConvertDeleteOneOption() option.FindOneAndDeleteOptioner

ConvertDeleteOneOption implements the DeleteOne interface

func (*DeleteOneBundle) MaxTime

func (dob *DeleteOneBundle) MaxTime(d time.Duration) *DeleteOneBundle

MaxTime adds an option to specify the max time to allow the query to run.

func (*DeleteOneBundle) Projection

func (dob *DeleteOneBundle) Projection(projection interface{}) *DeleteOneBundle

Projection adds an option to limit the fields returned for all documents.

func (*DeleteOneBundle) Sort

func (dob *DeleteOneBundle) Sort(sort interface{}) *DeleteOneBundle

Sort adds an option to specify the order in which to return results.

func (*DeleteOneBundle) String

func (dob *DeleteOneBundle) String() string

String implements the Stringer interface

func (*DeleteOneBundle) Unbundle

func (dob *DeleteOneBundle) Unbundle(deduplicate bool) ([]option.FindOneAndDeleteOptioner, *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 FindBundle can be recursive, this method will unwind all recursive FindBundles.

type DeleteOneOption added in v0.0.10

type DeleteOneOption interface {
	DeleteOne
	ConvertDeleteOneOption() option.FindOneAndDeleteOptioner
}

DeleteOneOption represents the options for the deleteOne() function.

type DeleteOneSession added in v0.0.10

type DeleteOneSession interface {
	DeleteOne
	ConvertDeleteOneSession() *session.Client
}

DeleteOneSession is the session for the deleteOne() function

type Find

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

Find represents all passable params for the find() function.

type FindBundle

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

FindBundle is a bundle of Find options

func BundleFind

func BundleFind(opts ...Find) *FindBundle

BundleFind bundles Find options

func (*FindBundle) AllowPartialResults

func (fb *FindBundle) AllowPartialResults(b bool) *FindBundle

AllowPartialResults adds an option to get partial results if some shards are down.

func (*FindBundle) BatchSize

func (fb *FindBundle) BatchSize(i int32) *FindBundle

BatchSize adds an option to specify the number of documents to return in every batch.

func (*FindBundle) Collation

func (fb *FindBundle) Collation(collation *mongoopt.Collation) *FindBundle

Collation adds an option to specify a Collation

func (*FindBundle) Comment

func (fb *FindBundle) Comment(s string) *FindBundle

Comment adds an option to specify a string to help trace the operation through the database profiler, currentOp, and logs.

func (*FindBundle) ConvertFindOption

func (fb *FindBundle) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface

func (*FindBundle) CursorType

func (fb *FindBundle) CursorType(ct mongoopt.CursorType) *FindBundle

CursorType adds an option to specify the type of cursor to use.

func (*FindBundle) Hint

func (fb *FindBundle) Hint(hint interface{}) *FindBundle

Hint adds an option to specify the index to use.

func (*FindBundle) Limit

func (fb *FindBundle) Limit(i int64) *FindBundle

Limit adds an option to set the limit on the number of results.

func (*FindBundle) Max

func (fb *FindBundle) Max(max interface{}) *FindBundle

Max adds an option to set an exclusive upper bound for a specific index.

func (*FindBundle) MaxAwaitTime

func (fb *FindBundle) MaxAwaitTime(d time.Duration) *FindBundle

MaxAwaitTime adds an option to specify the max amount of time for the server to wait on new documents.

func (*FindBundle) MaxScan

func (fb *FindBundle) MaxScan(i int64) *FindBundle

MaxScan adds an option to specify the max number of documents or index keys to scan.

func (*FindBundle) MaxTime

func (fb *FindBundle) MaxTime(d time.Duration) *FindBundle

MaxTime adds an option to specify the max time to allow the query to run.

func (*FindBundle) Min

func (fb *FindBundle) Min(min interface{}) *FindBundle

Min adds an option to specify the inclusive lower bound for a specific index.

func (*FindBundle) NoCursorTimeout

func (fb *FindBundle) NoCursorTimeout(b bool) *FindBundle

NoCursorTimeout adds an option to prevent cursors from timing out after an inactivity period.

func (*FindBundle) OplogReplay

func (fb *FindBundle) OplogReplay(b bool) *FindBundle

OplogReplay adds an option for internal use only and should not be set.

func (*FindBundle) Projection

func (fb *FindBundle) Projection(projection interface{}) *FindBundle

Projection adds an option to limit the fields returned for all documents.

func (*FindBundle) ReturnKey

func (fb *FindBundle) ReturnKey(b bool) *FindBundle

ReturnKey adds an option to only return index keys for all result documents.

func (*FindBundle) ShowRecordID

func (fb *FindBundle) ShowRecordID(b bool) *FindBundle

ShowRecordID sets an option to determine whether to return the record identifier for each document.

func (*FindBundle) Skip

func (fb *FindBundle) Skip(i int64) *FindBundle

Skip adds an option to specify the number of documents to skip before returning.

func (*FindBundle) Snapshot

func (fb *FindBundle) Snapshot(b bool) *FindBundle

Snapshot adds an option to prevent the cursor from returning a document more than once because of an intervening write operation.

func (*FindBundle) Sort

func (fb *FindBundle) Sort(sort interface{}) *FindBundle

Sort adds an option to specify the order in which to return results.

func (*FindBundle) String

func (fb *FindBundle) String() string

String implements the Stringer interface

func (*FindBundle) Unbundle

func (fb *FindBundle) Unbundle(deduplicate bool) ([]option.FindOptioner, *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 FindBundle can be recursive, this method will unwind all recursive FindBundles.

type FindOneOption added in v0.0.10

type FindOneOption interface {
	One
	ConvertFindOneOption() option.FindOptioner
}

FindOneOption represents the options for the findOne() function.

type FindOneSession added in v0.0.10

type FindOneSession interface {
	One
	ConvertFindOneSession() *session.Client
}

FindOneSession is the session for the findOne() function

type FindOption added in v0.0.10

type FindOption interface {
	Find
	ConvertFindOption() option.FindOptioner
}

FindOption represents the options for the find() function.

type FindSession added in v0.0.10

type FindSession interface {
	Find
	ConvertFindSession() *session.Client
}

FindSession is the session for the find() function

type FindSessionOpt added in v0.0.10

type FindSessionOpt struct{}

FindSessionOpt is an find session option.

func (FindSessionOpt) ConvertDeleteOneSession added in v0.0.10

func (FindSessionOpt) ConvertDeleteOneSession() *session.Client

ConvertDeleteOneSession implements DeleteOneSession interface.

func (FindSessionOpt) ConvertFindOneSession added in v0.0.10

func (FindSessionOpt) ConvertFindOneSession() *session.Client

ConvertFindOneSession implements FindOneSession interface.

func (FindSessionOpt) ConvertFindSession added in v0.0.10

func (FindSessionOpt) ConvertFindSession() *session.Client

ConvertFindSession implements FindSession interface.

func (FindSessionOpt) ConvertReplaceOneSession added in v0.0.10

func (FindSessionOpt) ConvertReplaceOneSession() *session.Client

ConvertReplaceOneSession implements ReplaceOneSession interface.

func (FindSessionOpt) ConvertUpdateOneSession added in v0.0.10

func (FindSessionOpt) ConvertUpdateOneSession() *session.Client

ConvertUpdateOneSession implements UpdateOneSession interface.

type One

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

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

type OneBundle

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

OneBundle is a bundle of FindOne options

func BundleOne

func BundleOne(opts ...One) *OneBundle

BundleOne bundles FindOne options

func (*OneBundle) AllowPartialResults

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

AllowPartialResults adds an option to get partial results if some shards are down.

func (*OneBundle) BatchSize

func (ob *OneBundle) BatchSize(i int32) *OneBundle

BatchSize adds an option to specify the number of documents to return in every batch.

func (*OneBundle) Collation

func (ob *OneBundle) Collation(collation *mongoopt.Collation) *OneBundle

Collation adds an option to specify a Collation.

func (*OneBundle) Comment

func (ob *OneBundle) Comment(s string) *OneBundle

Comment adds an option to specify a string to help trace the operation through teh database profiler, currentOp, and logs

func (*OneBundle) ConvertFindOneOption

func (ob *OneBundle) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the FindOne interface

func (*OneBundle) CursorType

func (ob *OneBundle) CursorType(ct mongoopt.CursorType) *OneBundle

CursorType adds an option to specify the type of cursor to use.

func (*OneBundle) Hint

func (ob *OneBundle) Hint(hint interface{}) *OneBundle

Hint adds an option to specify the index to use.

func (*OneBundle) Max

func (ob *OneBundle) Max(max interface{}) *OneBundle

Max adds an option to set an exclusive upper bound for a specific index.

func (*OneBundle) MaxAwaitTime

func (ob *OneBundle) MaxAwaitTime(d time.Duration) *OneBundle

MaxAwaitTime adds an option to specify the max amount of time for the server to wait on new documents.

func (*OneBundle) MaxScan

func (ob *OneBundle) MaxScan(i int64) *OneBundle

MaxScan adds an option to specify the number of documents or index keys to scan.

func (*OneBundle) MaxTime

func (ob *OneBundle) MaxTime(d time.Duration) *OneBundle

MaxTime adds an option to specify the max time to allow the query to run.

func (*OneBundle) Min

func (ob *OneBundle) Min(min interface{}) *OneBundle

Min adds an option to specify the inclusive lower bound for a specific index.

func (*OneBundle) NoCursorTimeout

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

NoCursorTimeout adds an option to prevent cursors from timing out after an inactivity period.

func (*OneBundle) OplogReplay

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

OplogReplay adds an option for internal use only and should not be set.

func (*OneBundle) Projection

func (ob *OneBundle) Projection(projection interface{}) *OneBundle

Projection adds an option to limit the fields returned for all documents.

func (*OneBundle) ReturnKey

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

ReturnKey adds an option to only return index keys for all results.

func (*OneBundle) ShowRecordID

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

ShowRecordID adds an option to determine whether to return the record identifier for each document.

func (*OneBundle) Skip

func (ob *OneBundle) Skip(i int64) *OneBundle

Skip adds an option to specify the number of documents to skip before returning.

func (*OneBundle) Snapshot

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

Snapshot adds an option to prevent the server from returning multiple copies because of an intervening write operation

func (*OneBundle) Sort

func (ob *OneBundle) Sort(sort interface{}) *OneBundle

Sort adds an option to specify the order in which to return results.

func (*OneBundle) String

func (ob *OneBundle) String() string

String implements the Stringer interface

func (*OneBundle) Unbundle

func (ob *OneBundle) Unbundle(deduplicate bool) ([]option.FindOptioner, *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 FindBundle can be recursive, this method will unwind all recursive FindBundles.

type OptAllowPartialResults

type OptAllowPartialResults option.OptAllowPartialResults

OptAllowPartialResults gets partial results if some shards are down.

func AllowPartialResults

func AllowPartialResults(b bool) OptAllowPartialResults

AllowPartialResults gets partial results if some shards are down. Find, One

func (OptAllowPartialResults) ConvertFindOneOption

func (opt OptAllowPartialResults) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptAllowPartialResults) ConvertFindOption

func (opt OptAllowPartialResults) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptArrayFilters

type OptArrayFilters option.OptArrayFilters

OptArrayFilters specifies which array elements an update should apply.

func ArrayFilters

func ArrayFilters(filters ...interface{}) OptArrayFilters

ArrayFilters specifies which array elements an update should apply. UpdateOne

func (OptArrayFilters) ConvertUpdateOneOption

func (opt OptArrayFilters) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner

ConvertUpdateOneOption implements the UpdateOne interface.

type OptBatchSize

type OptBatchSize option.OptBatchSize

OptBatchSize specifies the number of documents to return in each batch.

func BatchSize

func BatchSize(i int32) OptBatchSize

BatchSize specifies the number of documents to return in each batch. Find, One

func (OptBatchSize) ConvertFindOneOption

func (opt OptBatchSize) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptBatchSize) ConvertFindOption

func (opt OptBatchSize) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptBypassDocumentValidation

type OptBypassDocumentValidation option.OptBypassDocumentValidation

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

func BypassDocumentValidation

func BypassDocumentValidation(b bool) OptBypassDocumentValidation

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

func (OptBypassDocumentValidation) ConvertReplaceOneOption

func (opt OptBypassDocumentValidation) ConvertReplaceOneOption() option.FindOneAndReplaceOptioner

ConvertReplaceOneOption implements the ReplaceOne interface.

func (OptBypassDocumentValidation) ConvertUpdateOneOption

func (opt OptBypassDocumentValidation) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner

ConvertUpdateOneOption implements the UpdateOne interface.

type OptCollation

type OptCollation option.OptCollation

OptCollation specifies a Collation.

func Collation

func Collation(collation *mongoopt.Collation) OptCollation

Collation specifies a Collation. Find, One, DeleteOne, ReplaceOne, UpdateOne

func (OptCollation) ConvertDeleteOneOption

func (opt OptCollation) ConvertDeleteOneOption() option.FindOneAndDeleteOptioner

ConvertDeleteOneOption implements the DeleteOne interface.

func (OptCollation) ConvertFindOneOption

func (opt OptCollation) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptCollation) ConvertFindOption

func (opt OptCollation) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

func (OptCollation) ConvertReplaceOneOption

func (opt OptCollation) ConvertReplaceOneOption() option.FindOneAndReplaceOptioner

ConvertReplaceOneOption implements the ReplaceOne interface.

func (OptCollation) ConvertUpdateOneOption

func (opt OptCollation) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner

ConvertUpdateOneOption implements the UpdateOne interface.

type OptComment

type OptComment option.OptComment

OptComment specifies a string to help trace the operation through the database profiler, currentOp, and logs.

func Comment

func Comment(s string) OptComment

Comment specifies a string to help trace the operation through the database profiler, currentOp, and logs. Find, One

func (OptComment) ConvertFindOneOption

func (opt OptComment) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptComment) ConvertFindOption

func (opt OptComment) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptCursorType

type OptCursorType option.OptCursorType

OptCursorType specifies the type of cursor to use.

func CursorType

func CursorType(ct mongoopt.CursorType) OptCursorType

CursorType specifies the type of cursor to use. Find, One

func (OptCursorType) ConvertFindOneOption

func (opt OptCursorType) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptCursorType) ConvertFindOption

func (opt OptCursorType) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptFields

type OptFields option.OptFields

OptFields limits the fields returned for find/modify commands.

func (OptFields) ConvertDeleteOneOption

func (opt OptFields) ConvertDeleteOneOption() option.FindOneAndDeleteOptioner

ConvertDeleteOneOption implements the DeleteOne interface.

func (OptFields) ConvertReplaceOneOption

func (opt OptFields) ConvertReplaceOneOption() option.FindOneAndReplaceOptioner

ConvertReplaceOneOption implements the ReplaceOne interface.

func (OptFields) ConvertUpdateOneOption

func (opt OptFields) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner

ConvertUpdateOneOption implements the UpdateOne interface.

type OptHint

type OptHint option.OptHint

OptHint specifies which index to use.

func Hint

func Hint(hint interface{}) OptHint

Hint specifies which index to use. Find, One

func (OptHint) ConvertFindOneOption

func (opt OptHint) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptHint) ConvertFindOption

func (opt OptHint) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptLimit

type OptLimit option.OptLimit

OptLimit sets a limit on the number of results.

func Limit

func Limit(i int64) OptLimit

Limit sets a limit on the number of results. Find

func (OptLimit) ConvertFindOption

func (opt OptLimit) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptMax

type OptMax option.OptMax

OptMax sets an exclusive upper bound for a specific index.

func Max

func Max(max interface{}) OptMax

Max sets an exclusive upper bound for a specific index. Find, One

func (OptMax) ConvertFindOneOption

func (opt OptMax) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptMax) ConvertFindOption

func (opt OptMax) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptMaxAwaitTime

type OptMaxAwaitTime option.OptMaxAwaitTime

OptMaxAwaitTime specifies the max amount of time for the server to wait on new documents.

func MaxAwaitTime

func MaxAwaitTime(d time.Duration) OptMaxAwaitTime

MaxAwaitTime specifies the max amount of time for the server to wait on new documents. Find, One

func (OptMaxAwaitTime) ConvertFindOneOption

func (opt OptMaxAwaitTime) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptMaxAwaitTime) ConvertFindOption

func (opt OptMaxAwaitTime) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptMaxScan

type OptMaxScan option.OptMaxScan

OptMaxScan specifies the maximum number of documents or index keys to scan.

func MaxScan

func MaxScan(i int64) OptMaxScan

MaxScan specifies the maximum number of documents or index keys to scan. Find, One

func (OptMaxScan) ConvertFindOneOption

func (opt OptMaxScan) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptMaxScan) ConvertFindOption

func (opt OptMaxScan) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptMaxTime

type OptMaxTime option.OptMaxTime

OptMaxTime specifies the max time to allow the query to run.

func MaxTime

func MaxTime(d time.Duration) OptMaxTime

MaxTime specifies the max time to allow the query to run. Find, One, DeleteOne, ReplaceOne, UpdateOne

func (OptMaxTime) ConvertDeleteOneOption

func (opt OptMaxTime) ConvertDeleteOneOption() option.FindOneAndDeleteOptioner

ConvertDeleteOneOption implements the DeleteOne interface.

func (OptMaxTime) ConvertFindOneOption

func (opt OptMaxTime) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptMaxTime) ConvertFindOption

func (opt OptMaxTime) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

func (OptMaxTime) ConvertReplaceOneOption

func (opt OptMaxTime) ConvertReplaceOneOption() option.FindOneAndReplaceOptioner

ConvertReplaceOneOption implements the ReplaceOne interface.

func (OptMaxTime) ConvertUpdateOneOption

func (opt OptMaxTime) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner

ConvertUpdateOneOption implements the UpdateOne interface.

type OptMin

type OptMin option.OptMin

OptMin specifies the inclusive lower bound for a specific index.

func Min

func Min(min interface{}) OptMin

Min specifies the inclusive lower bound for a specific index. Find, One

func (OptMin) ConvertFindOneOption

func (opt OptMin) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptMin) ConvertFindOption

func (opt OptMin) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptNoCursorTimeout

type OptNoCursorTimeout option.OptNoCursorTimeout

OptNoCursorTimeout prevents cursors from timing out after an inactivity period.

func NoCursorTimeout

func NoCursorTimeout(b bool) OptNoCursorTimeout

NoCursorTimeout prevents cursors from timing out after an inactivity period. Find, One

func (OptNoCursorTimeout) ConvertFindOneOption

func (opt OptNoCursorTimeout) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptNoCursorTimeout) ConvertFindOption

func (opt OptNoCursorTimeout) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptOplogReplay

type OptOplogReplay option.OptOplogReplay

OptOplogReplay is for internal use and should not be set.

func OplogReplay

func OplogReplay(b bool) OptOplogReplay

OplogReplay is for internal use and should not be set. Find, One

func (OptOplogReplay) ConvertFindOneOption

func (opt OptOplogReplay) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptOplogReplay) ConvertFindOption

func (opt OptOplogReplay) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptProjection

type OptProjection option.OptProjection

OptProjection limits the fields returned for all documents.

func Projection

func Projection(projection interface{}) OptProjection

Projection limits the fields returned for all documents. Find, One, DeleteOne, ReplaceOne, UpdateOne

func (OptProjection) ConvertDeleteOneOption

func (opt OptProjection) ConvertDeleteOneOption() option.FindOneAndDeleteOptioner

ConvertDeleteOneOption implements the DeleteOne interface.

func (OptProjection) ConvertFindOneOption

func (opt OptProjection) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptProjection) ConvertFindOption

func (opt OptProjection) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

func (OptProjection) ConvertReplaceOneOption

func (opt OptProjection) ConvertReplaceOneOption() option.FindOneAndReplaceOptioner

ConvertReplaceOneOption option implements the ReplaceOne interface.

func (OptProjection) ConvertUpdateOneOption

func (opt OptProjection) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner

ConvertUpdateOneOption option implements the UpdateOne interface.

type OptReturnDocument

type OptReturnDocument option.OptReturnDocument

OptReturnDocument specifies whether to return the updated or original document.

func ReturnDocument

func ReturnDocument(rd mongoopt.ReturnDocument) OptReturnDocument

ReturnDocument specifies whether to return the updated or original document. ReplaceOne, UpdateOne

func (OptReturnDocument) ConvertReplaceOneOption

func (opt OptReturnDocument) ConvertReplaceOneOption() option.FindOneAndReplaceOptioner

ConvertReplaceOneOption implements the ReplaceOne interface.

func (OptReturnDocument) ConvertUpdateOneOption

func (opt OptReturnDocument) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner

ConvertUpdateOneOption implements the UpdateOne interface.

type OptReturnKey

type OptReturnKey option.OptReturnKey

OptReturnKey specifies whether only index keys should be returned for results.

func ReturnKey

func ReturnKey(b bool) OptReturnKey

ReturnKey specifies whether only index keys should be returned for results. Find, One

func (OptReturnKey) ConvertFindOneOption

func (opt OptReturnKey) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptReturnKey) ConvertFindOption

func (opt OptReturnKey) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptShowRecordID

type OptShowRecordID option.OptShowRecordID

OptShowRecordID specifies whether to return the record identifier for each document.

func ShowRecordID

func ShowRecordID(b bool) OptShowRecordID

ShowRecordID specifies whether to return the record identifier for each document. Find, One

func (OptShowRecordID) ConvertFindOneOption

func (opt OptShowRecordID) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptShowRecordID) ConvertFindOption

func (opt OptShowRecordID) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptSkip

type OptSkip option.OptSkip

OptSkip specifies the number of documents to skip before returning.

func Skip

func Skip(i int64) OptSkip

Skip specifies the number of documents to skip before returning. Find, One

func (OptSkip) ConvertFindOneOption

func (opt OptSkip) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptSkip) ConvertFindOption

func (opt OptSkip) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptSnapshot

type OptSnapshot option.OptSnapshot

OptSnapshot prevents the cursor from returning a document more than once because of an intervening write operation.

func Snapshot

func Snapshot(b bool) OptSnapshot

Snapshot prevents the cursor from returning a document more than once because of an intervening write operation. Find, One

func (OptSnapshot) ConvertFindOneOption

func (opt OptSnapshot) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptSnapshot) ConvertFindOption

func (opt OptSnapshot) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

type OptSort

type OptSort option.OptSort

OptSort specifies the order in which to return results.

func Sort

func Sort(sort interface{}) OptSort

Sort specifies the order in which to return results. Find, One, DeleteOne, ReplaceOne, UpdateOne

func (OptSort) ConvertDeleteOneOption

func (opt OptSort) ConvertDeleteOneOption() option.FindOneAndDeleteOptioner

ConvertDeleteOneOption implements the DeleteOne interface.

func (OptSort) ConvertFindOneOption

func (opt OptSort) ConvertFindOneOption() option.FindOptioner

ConvertFindOneOption implements the One interface.

func (OptSort) ConvertFindOption

func (opt OptSort) ConvertFindOption() option.FindOptioner

ConvertFindOption implements the Find interface.

func (OptSort) ConvertReplaceOneOption

func (opt OptSort) ConvertReplaceOneOption() option.FindOneAndReplaceOptioner

ConvertReplaceOneOption implements the ReplaceOne interface.

func (OptSort) ConvertUpdateOneOption

func (opt OptSort) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner

ConvertUpdateOneOption implements the UpdateOne interface.

type OptUpsert

type OptUpsert option.OptUpsert

OptUpsert specifies whether a document should be inserted if no match is found.

func Upsert

func Upsert(b bool) OptUpsert

Upsert specifies whether a document should be inserted if no match is found. ReplaceOne, UpdateOne

func (OptUpsert) ConvertReplaceOneOption

func (opt OptUpsert) ConvertReplaceOneOption() option.FindOneAndReplaceOptioner

ConvertReplaceOneOption implements the ReplaceOne interface.

func (OptUpsert) ConvertUpdateOneOption

func (opt OptUpsert) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner

ConvertUpdateOneOption implements the UpdateOne interface.

type ReplaceOne

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

ReplaceOne represents all passable params for the replaceOne() function.

type ReplaceOneBundle

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

ReplaceOneBundle is a bundle of FindOneAndReplace options

func BundleReplaceOne

func BundleReplaceOne(opts ...ReplaceOne) *ReplaceOneBundle

BundleReplaceOne bundles FindOneAndReplace options

func (*ReplaceOneBundle) BypassDocumentValidation

func (rob *ReplaceOneBundle) BypassDocumentValidation(b bool) *ReplaceOneBundle

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

func (*ReplaceOneBundle) Collation

func (rob *ReplaceOneBundle) Collation(collation *mongoopt.Collation) *ReplaceOneBundle

Collation adds an option to specify a Collation.

func (*ReplaceOneBundle) ConvertReplaceOneOption

func (rob *ReplaceOneBundle) ConvertReplaceOneOption() option.FindOneAndReplaceOptioner

ConvertReplaceOneOption implements ReplaceOne interface

func (*ReplaceOneBundle) MaxTime

MaxTime adds an option to specify the max time to allow the query to run.

func (*ReplaceOneBundle) Projection

func (rob *ReplaceOneBundle) Projection(projection interface{}) *ReplaceOneBundle

Projection adds an option to limit the fields returned for all documents.

func (*ReplaceOneBundle) ReturnDocument

func (rob *ReplaceOneBundle) ReturnDocument(rd mongoopt.ReturnDocument) *ReplaceOneBundle

ReturnDocument adds an option to specify whether to return the updated or original document.

func (*ReplaceOneBundle) Sort

func (rob *ReplaceOneBundle) Sort(sort interface{}) *ReplaceOneBundle

Sort adds an option to specify the order in which to return results.

func (*ReplaceOneBundle) String

func (rob *ReplaceOneBundle) String() string

String implements the Stringer interface

func (*ReplaceOneBundle) Unbundle

func (rob *ReplaceOneBundle) Unbundle(deduplicate bool) ([]option.FindOneAndReplaceOptioner, *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 FindBundle can be recursive, this method will unwind all recursive FindBundles.

func (*ReplaceOneBundle) Upsert

func (rob *ReplaceOneBundle) Upsert(b bool) *ReplaceOneBundle

Upsert adds an option to specify whether to create a new document if no document matches the query.

type ReplaceOneOption added in v0.0.10

type ReplaceOneOption interface {
	ReplaceOne
	ConvertReplaceOneOption() option.FindOneAndReplaceOptioner
}

ReplaceOneOption represents the options for the replaceOne() function.

type ReplaceOneSession added in v0.0.10

type ReplaceOneSession interface {
	ReplaceOne
	ConvertReplaceOneSession() *session.Client
}

ReplaceOneSession is the session for the replaceOne() function

type UpdateOne

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

UpdateOne represents all passable params for the updateOne() function.

type UpdateOneBundle

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

UpdateOneBundle is a bundle of FindOneAndUpdate options

func BundleUpdateOne

func BundleUpdateOne(opts ...UpdateOne) *UpdateOneBundle

BundleUpdateOne bundles FindOneAndUpdate options

func (*UpdateOneBundle) ArrayFilters

func (uob *UpdateOneBundle) ArrayFilters(filters ...interface{}) *UpdateOneBundle

ArrayFilters adds an option to specify which array elements an update should apply.

func (*UpdateOneBundle) BypassDocumentValidation

func (uob *UpdateOneBundle) BypassDocumentValidation(b bool) *UpdateOneBundle

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

func (*UpdateOneBundle) Collation

func (uob *UpdateOneBundle) Collation(collation *mongoopt.Collation) *UpdateOneBundle

Collation adds an option to specify a collation.

func (*UpdateOneBundle) ConvertUpdateOneOption

func (uob *UpdateOneBundle) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner

ConvertUpdateOneOption implements the UpdateOne interface

func (*UpdateOneBundle) MaxTime

func (uob *UpdateOneBundle) MaxTime(d time.Duration) *UpdateOneBundle

MaxTime adds an option to specify the max time to allow the query to run.

func (*UpdateOneBundle) Projection

func (uob *UpdateOneBundle) Projection(projection interface{}) *UpdateOneBundle

Projection adds an option to limit the fields returned for all documents.

func (*UpdateOneBundle) ReturnDocument

func (uob *UpdateOneBundle) ReturnDocument(rd mongoopt.ReturnDocument) *UpdateOneBundle

ReturnDocument adds an option to specify whether to return the updated or original document.

func (*UpdateOneBundle) Sort

func (uob *UpdateOneBundle) Sort(sort interface{}) *UpdateOneBundle

Sort adds an option to specify the order in which to return results.

func (*UpdateOneBundle) String

func (uob *UpdateOneBundle) String() string

String implements the Stringer interface

func (*UpdateOneBundle) Unbundle

func (uob *UpdateOneBundle) Unbundle(deduplicate bool) ([]option.FindOneAndUpdateOptioner, *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 FindBundle can be recursive, this method will unwind all recursive FindBundles.

func (*UpdateOneBundle) Upsert

func (uob *UpdateOneBundle) Upsert(b bool) *UpdateOneBundle

Upsert adds an option to specify whether to create a new document if no document matches the query.

type UpdateOneOption added in v0.0.10

type UpdateOneOption interface {
	UpdateOne
	ConvertUpdateOneOption() option.FindOneAndUpdateOptioner
}

UpdateOneOption represents the options for the updateOne() function.

type UpdateOneSession added in v0.0.10

type UpdateOneSession interface {
	UpdateOne
	ConvertUpdateOneSession() *session.Client
}

UpdateOneSession is the session for the updateOne() function

Jump to

Keyboard shortcuts

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