Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnsupportedType = errors.New("infra: unsupported type") ErrNotFound = errors.New("document: not found") ErrDuplicateKey = errors.New("infra: duplicate key") ErrInvalidData = errors.New("infra: invalid data") )
List of errors
Functions ¶
This section is empty.
Types ¶
type BulkWriteModel ¶
type BulkWriteModel mongo.WriteModel
type Index ¶
type Index struct { Name string Keys []IndexKey Unique *bool Sparse *bool ExpireAfter *time.Duration }
Index holds database index
type NoSql ¶
type NoSql interface { Ping(ctx context.Context) error Disconnect(ctx context.Context) error EnsureIndices(ctx context.Context, tab string, index []Index) error DropIndices(ctx context.Context, tab string, index []Index) error Insert(ctx context.Context, tab string, v interface{}) error Update(ctx context.Context, col string, filter interface{}, data interface{}) error InsertMany(ctx context.Context, tab string, v []interface{}) error Count(ctx context.Context, col string, q interface{}) (int64, error) List(ctx context.Context, tab string, filter interface{}, skip, limit int64, v interface{}, sort ...interface{}) error FindOne(ctx context.Context, tab string, filter interface{}, v interface{}, sort ...interface{}) error PartialUpdateMany(ctx context.Context, col string, filter interface{}, data interface{}) error PartialUpdateManyByQuery(ctx context.Context, col string, filter interface{}, query UnorderedDbQuery) error BulkUpdate(ctx context.Context, col string, models []mongo.WriteModel) error Aggregate(ctx context.Context, col string, q []interface{}, v interface{}) error AggregateWithDiskUse(ctx context.Context, col string, q []interface{}, v interface{}) error Distinct(ctx context.Context, col, field string, q interface{}, v interface{}) error DeleteMany(ctx context.Context, col string, filter interface{}) error }
NoSql interface wraps the database
type UnorderedDbQuery ¶
Click to show internal directories.
Click to hide internal directories.