Documentation ¶
Index ¶
- type DeleteOne
- type DeleteOneBundle
- func (dob *DeleteOneBundle) Collation(collation *mongoopt.Collation) *DeleteOneBundle
- func (dob *DeleteOneBundle) ConvertDeleteOneOption() option.FindOneAndDeleteOptioner
- func (dob *DeleteOneBundle) MaxTime(d time.Duration) *DeleteOneBundle
- func (dob *DeleteOneBundle) Projection(projection interface{}) *DeleteOneBundle
- func (dob *DeleteOneBundle) Sort(sort interface{}) *DeleteOneBundle
- func (dob *DeleteOneBundle) String() string
- func (dob *DeleteOneBundle) Unbundle(deduplicate bool) ([]option.FindOneAndDeleteOptioner, *session.Client, error)
- type DeleteOneOption
- type DeleteOneSession
- type Find
- type FindBundle
- func (fb *FindBundle) AllowPartialResults(b bool) *FindBundle
- func (fb *FindBundle) BatchSize(i int32) *FindBundle
- func (fb *FindBundle) Collation(collation *mongoopt.Collation) *FindBundle
- func (fb *FindBundle) Comment(s string) *FindBundle
- func (fb *FindBundle) ConvertFindOption() option.FindOptioner
- func (fb *FindBundle) CursorType(ct mongoopt.CursorType) *FindBundle
- func (fb *FindBundle) Hint(hint interface{}) *FindBundle
- func (fb *FindBundle) Limit(i int64) *FindBundle
- func (fb *FindBundle) Max(max interface{}) *FindBundle
- func (fb *FindBundle) MaxAwaitTime(d time.Duration) *FindBundle
- func (fb *FindBundle) MaxTime(d time.Duration) *FindBundle
- func (fb *FindBundle) Min(min interface{}) *FindBundle
- func (fb *FindBundle) NoCursorTimeout(b bool) *FindBundle
- func (fb *FindBundle) OplogReplay(b bool) *FindBundle
- func (fb *FindBundle) Projection(projection interface{}) *FindBundle
- func (fb *FindBundle) ReturnKey(b bool) *FindBundle
- func (fb *FindBundle) ShowRecordID(b bool) *FindBundle
- func (fb *FindBundle) Skip(i int64) *FindBundle
- func (fb *FindBundle) Sort(sort interface{}) *FindBundle
- func (fb *FindBundle) String() string
- func (fb *FindBundle) Unbundle(deduplicate bool) ([]option.FindOptioner, *session.Client, error)
- type FindOneOption
- type FindOneSession
- type FindOption
- type FindSession
- type FindSessionOpt
- func (FindSessionOpt) ConvertDeleteOneSession() *session.Client
- func (FindSessionOpt) ConvertFindOneSession() *session.Client
- func (FindSessionOpt) ConvertFindSession() *session.Client
- func (FindSessionOpt) ConvertReplaceOneSession() *session.Client
- func (FindSessionOpt) ConvertUpdateOneSession() *session.Client
- type One
- type OneBundle
- func (ob *OneBundle) AllowPartialResults(b bool) *OneBundle
- func (ob *OneBundle) BatchSize(i int32) *OneBundle
- func (ob *OneBundle) Collation(collation *mongoopt.Collation) *OneBundle
- func (ob *OneBundle) Comment(s string) *OneBundle
- func (ob *OneBundle) ConvertFindOneOption() option.FindOptioner
- func (ob *OneBundle) CursorType(ct mongoopt.CursorType) *OneBundle
- func (ob *OneBundle) Hint(hint interface{}) *OneBundle
- func (ob *OneBundle) Max(max interface{}) *OneBundle
- func (ob *OneBundle) MaxAwaitTime(d time.Duration) *OneBundle
- func (ob *OneBundle) MaxTime(d time.Duration) *OneBundle
- func (ob *OneBundle) Min(min interface{}) *OneBundle
- func (ob *OneBundle) NoCursorTimeout(b bool) *OneBundle
- func (ob *OneBundle) OplogReplay(b bool) *OneBundle
- func (ob *OneBundle) Projection(projection interface{}) *OneBundle
- func (ob *OneBundle) ReturnKey(b bool) *OneBundle
- func (ob *OneBundle) ShowRecordID(b bool) *OneBundle
- func (ob *OneBundle) Skip(i int64) *OneBundle
- func (ob *OneBundle) Sort(sort interface{}) *OneBundle
- func (ob *OneBundle) String() string
- func (ob *OneBundle) Unbundle(deduplicate bool) ([]option.FindOptioner, *session.Client, error)
- type OptAllowPartialResults
- type OptArrayFilters
- type OptBatchSize
- type OptBypassDocumentValidation
- type OptCollation
- func (opt OptCollation) ConvertDeleteOneOption() option.FindOneAndDeleteOptioner
- func (opt OptCollation) ConvertFindOneOption() option.FindOptioner
- func (opt OptCollation) ConvertFindOption() option.FindOptioner
- func (opt OptCollation) ConvertReplaceOneOption() option.FindOneAndReplaceOptioner
- func (opt OptCollation) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner
- type OptComment
- type OptCursorType
- type OptFields
- type OptHint
- type OptLimit
- type OptMax
- type OptMaxAwaitTime
- type OptMaxTime
- func (opt OptMaxTime) ConvertDeleteOneOption() option.FindOneAndDeleteOptioner
- func (opt OptMaxTime) ConvertFindOneOption() option.FindOptioner
- func (opt OptMaxTime) ConvertFindOption() option.FindOptioner
- func (opt OptMaxTime) ConvertReplaceOneOption() option.FindOneAndReplaceOptioner
- func (opt OptMaxTime) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner
- type OptMin
- type OptNoCursorTimeout
- type OptOplogReplay
- type OptProjection
- func (opt OptProjection) ConvertDeleteOneOption() option.FindOneAndDeleteOptioner
- func (opt OptProjection) ConvertFindOneOption() option.FindOptioner
- func (opt OptProjection) ConvertFindOption() option.FindOptioner
- func (opt OptProjection) ConvertReplaceOneOption() option.FindOneAndReplaceOptioner
- func (opt OptProjection) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner
- type OptReturnDocument
- type OptReturnKey
- type OptShowRecordID
- type OptSkip
- type OptSort
- func (opt OptSort) ConvertDeleteOneOption() option.FindOneAndDeleteOptioner
- func (opt OptSort) ConvertFindOneOption() option.FindOptioner
- func (opt OptSort) ConvertFindOption() option.FindOptioner
- func (opt OptSort) ConvertReplaceOneOption() option.FindOneAndReplaceOptioner
- func (opt OptSort) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner
- type OptUpsert
- type ReplaceOne
- type ReplaceOneBundle
- func (rob *ReplaceOneBundle) BypassDocumentValidation(b bool) *ReplaceOneBundle
- func (rob *ReplaceOneBundle) Collation(collation *mongoopt.Collation) *ReplaceOneBundle
- func (rob *ReplaceOneBundle) ConvertReplaceOneOption() option.FindOneAndReplaceOptioner
- func (rob *ReplaceOneBundle) MaxTime(d time.Duration) *ReplaceOneBundle
- func (rob *ReplaceOneBundle) Projection(projection interface{}) *ReplaceOneBundle
- func (rob *ReplaceOneBundle) ReturnDocument(rd mongoopt.ReturnDocument) *ReplaceOneBundle
- func (rob *ReplaceOneBundle) Sort(sort interface{}) *ReplaceOneBundle
- func (rob *ReplaceOneBundle) String() string
- func (rob *ReplaceOneBundle) Unbundle(deduplicate bool) ([]option.FindOneAndReplaceOptioner, *session.Client, error)
- func (rob *ReplaceOneBundle) Upsert(b bool) *ReplaceOneBundle
- type ReplaceOneOption
- type ReplaceOneSession
- type UpdateOne
- type UpdateOneBundle
- func (uob *UpdateOneBundle) ArrayFilters(filters ...interface{}) *UpdateOneBundle
- func (uob *UpdateOneBundle) BypassDocumentValidation(b bool) *UpdateOneBundle
- func (uob *UpdateOneBundle) Collation(collation *mongoopt.Collation) *UpdateOneBundle
- func (uob *UpdateOneBundle) ConvertUpdateOneOption() option.FindOneAndUpdateOptioner
- func (uob *UpdateOneBundle) MaxTime(d time.Duration) *UpdateOneBundle
- func (uob *UpdateOneBundle) Projection(projection interface{}) *UpdateOneBundle
- func (uob *UpdateOneBundle) ReturnDocument(rd mongoopt.ReturnDocument) *UpdateOneBundle
- func (uob *UpdateOneBundle) Sort(sort interface{}) *UpdateOneBundle
- func (uob *UpdateOneBundle) String() string
- func (uob *UpdateOneBundle) Unbundle(deduplicate bool) ([]option.FindOneAndUpdateOptioner, *session.Client, error)
- func (uob *UpdateOneBundle) Upsert(b bool) *UpdateOneBundle
- type UpdateOneOption
- type UpdateOneSession
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
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 (*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) 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) 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
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
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 (*OneBundle) AllowPartialResults ¶
AllowPartialResults adds an option to get partial results if some shards are down.
func (*OneBundle) BatchSize ¶
BatchSize adds an option to specify the number of documents to return in every batch.
func (*OneBundle) Comment ¶
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) MaxAwaitTime ¶
MaxAwaitTime adds an option to specify the max amount of time for the server to wait on new documents.
func (*OneBundle) MaxTime ¶
MaxTime adds an option to specify the max time to allow the query to run.
func (*OneBundle) Min ¶
Min adds an option to specify the inclusive lower bound for a specific index.
func (*OneBundle) NoCursorTimeout ¶
NoCursorTimeout adds an option to prevent cursors from timing out after an inactivity period.
func (*OneBundle) OplogReplay ¶
OplogReplay adds an option for internal use only and should not be set.
func (*OneBundle) Projection ¶
Projection adds an option to limit the fields returned for all documents.
func (*OneBundle) ShowRecordID ¶
ShowRecordID adds an option to determine whether to return the record identifier for each document.
func (*OneBundle) Skip ¶
Skip adds an option to specify the number of documents to skip before returning.
func (*OneBundle) Unbundle ¶
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 ¶
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 ¶
OptHint specifies which index to use.
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 ¶
OptLimit sets a limit on the number of results.
func (OptLimit) ConvertFindOption ¶
func (opt OptLimit) ConvertFindOption() option.FindOptioner
ConvertFindOption implements the Find interface.
type 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 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 ¶
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 ¶
OptSkip specifies the number of documents to skip before returning.
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 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 ¶
OptUpsert specifies whether a document should be inserted if no match is found.
func Upsert ¶
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 ¶
func (rob *ReplaceOneBundle) MaxTime(d time.Duration) *ReplaceOneBundle
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
UpdateOneSession is the session for the updateOne() function