mirror of
https://github.com/mainnika/mongox-go-driver.git
synced 2026-06-12 16:53:35 +00:00
Add missing docs
This commit is contained in:
@@ -4,28 +4,34 @@ import (
|
|||||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Saver is an interface for documents that can be saved
|
||||||
type Saver interface {
|
type Saver interface {
|
||||||
Save(db *Database) error
|
Save(db *Database) error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deleter is an interface for documents that can be deleted
|
||||||
type Deleter interface {
|
type Deleter interface {
|
||||||
Delete(db *Database) error
|
Delete(db *Database) error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Loader is an interface for documents that can be loaded
|
||||||
type Loader interface {
|
type Loader interface {
|
||||||
Load(db *Database, filters ...interface{}) error
|
Load(db *Database, filters ...interface{}) error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BaseObjectID is an interface for documents that have objectId type for the _id field
|
||||||
type BaseObjectID interface {
|
type BaseObjectID interface {
|
||||||
GetID() primitive.ObjectID
|
GetID() primitive.ObjectID
|
||||||
SetID(id primitive.ObjectID)
|
SetID(id primitive.ObjectID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BaseString is an interface for documents that have string type for the _id field
|
||||||
type BaseString interface {
|
type BaseString interface {
|
||||||
GetID() string
|
GetID() string
|
||||||
SetID(id string)
|
SetID(id string)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BaseObject is an interface for documents that have object type for the _id field
|
||||||
type BaseObject interface {
|
type BaseObject interface {
|
||||||
GetID() primitive.D
|
GetID() primitive.D
|
||||||
SetID(id primitive.D)
|
SetID(id primitive.D)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import (
|
|||||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ComposeQuery is a function to compose filters into a single query
|
// Compose is a function to compose filters into a single query
|
||||||
func Compose(filters ...interface{}) *Query {
|
func Compose(filters ...interface{}) *Query {
|
||||||
|
|
||||||
q := &Query{}
|
q := &Query{}
|
||||||
|
|||||||
Reference in New Issue
Block a user