Documentation ¶
Index ¶
- func RegisterPlugin(name string, cb callback.CbFn, opType operation.OpType)
- func RemovePlugin(name string, opType operation.OpType)
- type Collection
- func (c *Collection[T]) Aggregator() *aggregator.Aggregator[T]
- func (c *Collection[T]) Collection() *mongo.Collection
- func (c *Collection[T]) Creator() *creator.Creator[T]
- func (c *Collection[T]) Deleter() *deleter.Deleter[T]
- func (c *Collection[T]) Finder() *finder.Finder[T]
- func (c *Collection[T]) Updater() *updater.Updater[T]
- type Model
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterPlugin ¶ added in v0.14.0
func RemovePlugin ¶ added in v0.14.0
Types ¶
type Collection ¶
type Collection[T any] struct { // contains filtered or unexported fields }
func NewCollection ¶
func NewCollection[T any](collection *mongo.Collection) *Collection[T]
func (*Collection[T]) Aggregator ¶ added in v0.0.3
func (c *Collection[T]) Aggregator() *aggregator.Aggregator[T]
func (*Collection[T]) Collection ¶ added in v0.1.0
func (c *Collection[T]) Collection() *mongo.Collection
func (*Collection[T]) Creator ¶
func (c *Collection[T]) Creator() *creator.Creator[T]
func (*Collection[T]) Deleter ¶
func (c *Collection[T]) Deleter() *deleter.Deleter[T]
func (*Collection[T]) Finder ¶
func (c *Collection[T]) Finder() *finder.Finder[T]
func (*Collection[T]) Updater ¶
func (c *Collection[T]) Updater() *updater.Updater[T]
type Model ¶ added in v0.11.0
type Model struct { ID primitive.ObjectID `bson:"_id"` CreatedAt time.Time `bson:"created_at"` UpdatedAt time.Time `bson:"updated_at"` }
Model is a base struct which includes the following fields: - ID: the primary key of the document - CreatedAt: the time when the document was created - UpdatedAt: the time when the document was last updated It may be embedded into a struct to provide these fields. Example:
type User struct { mongox.Model }
func (*Model) DefaultCreatedAt ¶ added in v0.11.0
func (m *Model) DefaultCreatedAt()
func (*Model) DefaultUpdatedAt ¶ added in v0.11.0
func (m *Model) DefaultUpdatedAt()
Click to show internal directories.
Click to hide internal directories.