Versions in this module Expand all Collapse all v1 v1.4.0 Jun 29, 2022 Changes in this version + const AND + const EQ + const EXISTS + const GE + const GT + const IN + const LE + const LT + const NE + const OR + const REGEX + const SET + type A = bson.A + type Config struct + Database string + Hosts []string + Password string + Username string + func (c *Config) Repair() + type Conn struct + func Connect(ctx context.Context, conf Config) (*Conn, error) + func (conn *Conn) Close(ctx Context) error + func (conn *Conn) CountDocuments(ctx Context, collection string, filter M) (int64, error) + func (conn *Conn) CreateCollection(ctx Context, collection string, opts ...*options.CreateCollectionOptions) error + func (conn *Conn) CreateIndexes(ctx Context, collection string, opts []mongo.IndexModel) error + func (conn *Conn) Database() *mongo.Database + func (conn *Conn) DeleteByID(ctx Context, collection string, id PK) error + func (conn *Conn) DeleteMany(ctx Context, collection string, filter M) error + func (conn *Conn) DeleteOne(ctx Context, collection string, filter M) error + func (conn *Conn) Exists(ctx Context, collection string, filter M) (ok bool, err error) + func (conn *Conn) FindAll(ctx Context, collection string, dst interface{}, filter M, ...) error + func (conn *Conn) FindByID(ctx Context, collection string, id PK, dst interface{}) (ok bool, err error) + func (conn *Conn) FindOne(ctx Context, collection string, filter M, dst interface{}, ...) (ok bool, err error) + func (conn *Conn) InsertOne(ctx Context, collection string, document interface{}, returnID *PK) error + func (conn *Conn) Migrate(ctx Context, migrations map[int]Migration) error + func (conn *Conn) MigrateTo(ctx Context, migrations map[int]Migration, targetNumber int) error + func (conn *Conn) UpdateByID(ctx Context, collection string, id PK, update interface{}) error + func (conn *Conn) UpdateMany(ctx Context, collection string, filter M, update interface{}) error + func (conn *Conn) UpdateOne(ctx Context, collection string, filter M, update interface{}) error + type Context = context.Context + type M = bson.M + type Migration struct + Forward func(*Conn) error + Reverse func(*Conn) error + type PK = string