Documentation
¶
Index ¶
- type Client
- 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 Config
- type Database
- type Model
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v2.2.0
type Client struct {
// contains filtered or unexported fields
}
func (*Client) NewDatabase ¶ added in v2.2.0
type Collection ¶
type Collection[T any] struct { // contains filtered or unexported fields }
func NewCollection ¶
func NewCollection[T any](db *Database, collection string) *Collection[T]
func (*Collection[T]) Aggregator ¶
func (c *Collection[T]) Aggregator() *aggregator.Aggregator[T]
func (*Collection[T]) Collection ¶
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 Database ¶ added in v2.2.0
type Database struct {
// contains filtered or unexported fields
}
func (*Database) RegisterPlugin ¶ added in v2.2.0
type Model ¶
type Model struct { ID bson.ObjectID `bson:"_id,omitempty" mongox:"autoID"` CreatedAt time.Time `bson:"created_at"` UpdatedAt time.Time `bson:"updated_at"` DeletedAt time.Time `bson:"deleted_at,omitempty"` }
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 ¶
func (*Model) DefaultUpdatedAt ¶
Click to show internal directories.
Click to hide internal directories.