Documentation ¶
Index ¶
- Variables
- type Builder
- type IndexCreateBuilder
- func (c *IndexCreateBuilder) CommitQuorumInt(quorum int32) *IndexCreateBuilder
- func (c *IndexCreateBuilder) CommitQuorumMajority() *IndexCreateBuilder
- func (c *IndexCreateBuilder) CommitQuorumString(quorum string) *IndexCreateBuilder
- func (c *IndexCreateBuilder) CommitQuorumVotingMembers() *IndexCreateBuilder
- func (c *IndexCreateBuilder) Execute(ctx context.Context) ([]string, error)
- func (c *IndexCreateBuilder) MaxTime(d time.Duration) *IndexCreateBuilder
- type IndexDropBuilder
- type IndexListBuilder
- func (l *IndexListBuilder) BatchSize(i int32) *IndexListBuilder
- func (l *IndexListBuilder) Execute(ctx context.Context) ([]*mongo.IndexModel, error)
- func (l *IndexListBuilder) ExecuteSpecifications(ctx context.Context) ([]*mongo.IndexSpecification, error)
- func (l *IndexListBuilder) SetMaxTime(d time.Duration) *IndexListBuilder
- type IndexViewer
- type TypedBuilder
- func (b *TypedBuilder[D, I]) Build() *TypedCollection[D, I]
- func (b *TypedBuilder[D, I]) ReadConcern(rc *readconcern.ReadConcern) *TypedBuilder[D, I]
- func (b *TypedBuilder[D, I]) ReadPreference(rp *readpref.ReadPref) *TypedBuilder[D, I]
- func (b *TypedBuilder[D, I]) Registry(r *bsoncodec.Registry) *TypedBuilder[D, I]
- func (b *TypedBuilder[D, I]) WriteConcern(wc *writeconcern.WriteConcern) *TypedBuilder[D, I]
- type TypedCollection
- func (c *TypedCollection[D, I]) Aggregate(pipe aggregate.Pipeline) *executor.AggregateExecutor[D, I]
- func (c *TypedCollection[D, I]) BulkWrite() *executor.BulkWriteExecutor[D, I]
- func (c *TypedCollection[D, I]) CountDocuments(filter *filters.Filter) *executor.CountExecutor[D, I]
- func (c *TypedCollection[D, I]) DeleteMany(filter *filters.Filter) *executor.DeleteExecutor[D, I]
- func (c *TypedCollection[D, I]) DeleteOne(filter *filters.Filter) *executor.DeleteExecutor[D, I]
- func (c *TypedCollection[D, I]) Distinct(field string) *executor.DistinctExecutor
- func (c *TypedCollection[D, I]) Find(filter *filters.Filter) *executor.FindExecutor[D, I]
- func (c *TypedCollection[D, I]) FindByIds(ids []I) *executor.FindExecutor[D, I]
- func (c *TypedCollection[D, I]) FindOne(filter *filters.Filter) *executor.FindOneExecutor[D, I]
- func (c *TypedCollection[D, I]) FindOneAndUpdate(filter *filters.Filter, update *update.Update) *executor.FindOneAndUpdateExecutor[D, I]
- func (c *TypedCollection[D, I]) FindOneById(id I) *executor.FindOneExecutor[D, I]
- func (c *TypedCollection[D, I]) Indexes() *IndexViewer
- func (c *TypedCollection[D, I]) InsertMany(docs ...D) *executor.InsertManyExecutor[D, I]
- func (c *TypedCollection[D, I]) InsertOne(doc D) *executor.InsertOneExecutor[D, I]
- func (c *TypedCollection[D, I]) UpdateById(id I, update *update.Update) *executor.UpdateExecutor[D, I]
- func (c *TypedCollection[D, I]) UpdateMany(filter *filters.Filter, update *update.Update) *executor.UpdateExecutor[D, I]
- func (c *TypedCollection[D, I]) UpdateOne(filter *filters.Filter, update *update.Update) *executor.UpdateExecutor[D, I]
Constants ¶
This section is empty.
Variables ¶
var (
ErrEmptyIndex = errors.New("mongo: create index is empty")
)
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) ReadConcern ¶
func (b *Builder) ReadConcern(rc *readconcern.ReadConcern) *Builder
ReadConcern sets the value for the ReadConcern field.
func (*Builder) ReadPreference ¶
ReadPreference sets the value for the ReadPreference field.
func (*Builder) WriteConcern ¶
func (b *Builder) WriteConcern(wc *writeconcern.WriteConcern) *Builder
WriteConcern sets the value for the WriteConcern field.
type IndexCreateBuilder ¶
type IndexCreateBuilder struct {
// contains filtered or unexported fields
}
func (*IndexCreateBuilder) CommitQuorumInt ¶
func (c *IndexCreateBuilder) CommitQuorumInt(quorum int32) *IndexCreateBuilder
CommitQuorumInt sets the value for the CommitQuorum field as an int32.
func (*IndexCreateBuilder) CommitQuorumMajority ¶
func (c *IndexCreateBuilder) CommitQuorumMajority() *IndexCreateBuilder
CommitQuorumMajority sets the value for the CommitQuorum to special "majority" value.
func (*IndexCreateBuilder) CommitQuorumString ¶
func (c *IndexCreateBuilder) CommitQuorumString(quorum string) *IndexCreateBuilder
CommitQuorumString sets the value for the CommitQuorum field as a string.
func (*IndexCreateBuilder) CommitQuorumVotingMembers ¶
func (c *IndexCreateBuilder) CommitQuorumVotingMembers() *IndexCreateBuilder
CommitQuorumVotingMembers sets the value for the CommitQuorum to special "votingMembers" value.
func (*IndexCreateBuilder) Execute ¶
func (c *IndexCreateBuilder) Execute(ctx context.Context) ([]string, error)
func (*IndexCreateBuilder) MaxTime ¶
func (c *IndexCreateBuilder) MaxTime(d time.Duration) *IndexCreateBuilder
MaxTime sets the value for the MaxTime field.
NOTE(benjirewis): MaxTime will be deprecated in a future release. The more general Timeout option may be used in its place to control the amount of time that a single operation can run before returning an error. MaxTime is ignored if Timeout is set on the client.
type IndexDropBuilder ¶
type IndexDropBuilder struct {
// contains filtered or unexported fields
}
func (*IndexDropBuilder) MaxTime ¶
func (d *IndexDropBuilder) MaxTime(duration time.Duration) *IndexDropBuilder
type IndexListBuilder ¶
type IndexListBuilder struct {
// contains filtered or unexported fields
}
func (*IndexListBuilder) BatchSize ¶
func (l *IndexListBuilder) BatchSize(i int32) *IndexListBuilder
BatchSize sets the value for the BatchSize field.
func (*IndexListBuilder) Execute ¶
func (l *IndexListBuilder) Execute(ctx context.Context) ([]*mongo.IndexModel, error)
func (*IndexListBuilder) ExecuteSpecifications ¶
func (l *IndexListBuilder) ExecuteSpecifications(ctx context.Context) ([]*mongo.IndexSpecification, error)
func (*IndexListBuilder) SetMaxTime ¶
func (l *IndexListBuilder) SetMaxTime(d time.Duration) *IndexListBuilder
SetMaxTime sets the value for the MaxTime field.
NOTE(benjirewis): MaxTime will be deprecated in a future release. The more general Timeout option may be used in its place to control the amount of time that a single operation can run before returning an error. MaxTime is ignored if Timeout is set on the client.
type IndexViewer ¶
type IndexViewer struct {
// contains filtered or unexported fields
}
func FromIndexView ¶
func FromIndexView(view mongo.IndexView) *IndexViewer
func (*IndexViewer) Create ¶
func (i *IndexViewer) Create(idx ...*model.Index) *IndexCreateBuilder
func (*IndexViewer) DropAll ¶
func (i *IndexViewer) DropAll() *IndexDropBuilder
func (*IndexViewer) DropOne ¶
func (i *IndexViewer) DropOne(name string) *IndexDropBuilder
func (*IndexViewer) List ¶
func (i *IndexViewer) List() *IndexListBuilder
type TypedBuilder ¶
func NewTypedBuilder ¶
func (*TypedBuilder[D, I]) Build ¶
func (b *TypedBuilder[D, I]) Build() *TypedCollection[D, I]
func (*TypedBuilder[D, I]) ReadConcern ¶
func (b *TypedBuilder[D, I]) ReadConcern(rc *readconcern.ReadConcern) *TypedBuilder[D, I]
ReadConcern sets the value for the ReadConcern field.
func (*TypedBuilder[D, I]) ReadPreference ¶
func (b *TypedBuilder[D, I]) ReadPreference(rp *readpref.ReadPref) *TypedBuilder[D, I]
ReadPreference sets the value for the ReadPreference field.
func (*TypedBuilder[D, I]) Registry ¶
func (b *TypedBuilder[D, I]) Registry(r *bsoncodec.Registry) *TypedBuilder[D, I]
Registry sets the value for the Registry field.
func (*TypedBuilder[D, I]) WriteConcern ¶
func (b *TypedBuilder[D, I]) WriteConcern(wc *writeconcern.WriteConcern) *TypedBuilder[D, I]
WriteConcern sets the value for the WriteConcern field.
type TypedCollection ¶
func NewTypedCollection ¶
func NewTypedCollection[D bson.Doc[I], I bson.ID](primary, defaultReadpref *raw.Collection) *TypedCollection[D, I]
func (*TypedCollection[D, I]) Aggregate ¶
func (c *TypedCollection[D, I]) Aggregate(pipe aggregate.Pipeline) *executor.AggregateExecutor[D, I]
func (*TypedCollection[D, I]) BulkWrite ¶
func (c *TypedCollection[D, I]) BulkWrite() *executor.BulkWriteExecutor[D, I]
func (*TypedCollection[D, I]) CountDocuments ¶
func (c *TypedCollection[D, I]) CountDocuments(filter *filters.Filter) *executor.CountExecutor[D, I]
func (*TypedCollection[D, I]) DeleteMany ¶
func (c *TypedCollection[D, I]) DeleteMany(filter *filters.Filter) *executor.DeleteExecutor[D, I]
func (*TypedCollection[D, I]) DeleteOne ¶
func (c *TypedCollection[D, I]) DeleteOne(filter *filters.Filter) *executor.DeleteExecutor[D, I]
func (*TypedCollection[D, I]) Distinct ¶
func (c *TypedCollection[D, I]) Distinct(field string) *executor.DistinctExecutor
func (*TypedCollection[D, I]) Find ¶
func (c *TypedCollection[D, I]) Find(filter *filters.Filter) *executor.FindExecutor[D, I]
func (*TypedCollection[D, I]) FindByIds ¶
func (c *TypedCollection[D, I]) FindByIds(ids []I) *executor.FindExecutor[D, I]
func (*TypedCollection[D, I]) FindOne ¶
func (c *TypedCollection[D, I]) FindOne(filter *filters.Filter) *executor.FindOneExecutor[D, I]
func (*TypedCollection[D, I]) FindOneAndUpdate ¶
func (c *TypedCollection[D, I]) FindOneAndUpdate(filter *filters.Filter, update *update.Update) *executor.FindOneAndUpdateExecutor[D, I]
func (*TypedCollection[D, I]) FindOneById ¶
func (c *TypedCollection[D, I]) FindOneById(id I) *executor.FindOneExecutor[D, I]
func (*TypedCollection[D, I]) Indexes ¶
func (c *TypedCollection[D, I]) Indexes() *IndexViewer
func (*TypedCollection[D, I]) InsertMany ¶
func (c *TypedCollection[D, I]) InsertMany(docs ...D) *executor.InsertManyExecutor[D, I]
func (*TypedCollection[D, I]) InsertOne ¶
func (c *TypedCollection[D, I]) InsertOne(doc D) *executor.InsertOneExecutor[D, I]
func (*TypedCollection[D, I]) UpdateById ¶
func (c *TypedCollection[D, I]) UpdateById(id I, update *update.Update) *executor.UpdateExecutor[D, I]
func (*TypedCollection[D, I]) UpdateMany ¶
func (c *TypedCollection[D, I]) UpdateMany(filter *filters.Filter, update *update.Update) *executor.UpdateExecutor[D, I]
func (*TypedCollection[D, I]) UpdateOne ¶
func (c *TypedCollection[D, I]) UpdateOne(filter *filters.Filter, update *update.Update) *executor.UpdateExecutor[D, I]