Documentation
¶
Index ¶
- type Mongo
- func (m *Mongo) Disconnect() error
- func (m *Mongo) FindOne(collection string, filter interface{}) *mongo.SingleResult
- func (m *Mongo) FindOneAndDelete(collection string, filter interface{}) *mongo.SingleResult
- func (m *Mongo) Upsert(collection string, filter interface{}, update interface{}) *mongo.SingleResult
- type MongoImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mongo ¶
type Mongo struct {
// contains filtered or unexported fields
}
Mongo contains the mongo client and database instances
func (*Mongo) Disconnect ¶
Disconnect disconnects the mongo client
func (*Mongo) FindOne ¶
func (m *Mongo) FindOne(collection string, filter interface{}) *mongo.SingleResult
FindOne finds a single document that matches the filter in the given collection
func (*Mongo) FindOneAndDelete ¶
func (m *Mongo) FindOneAndDelete(collection string, filter interface{}) *mongo.SingleResult
FindOneAndDelete deletes a document that matches the filter in the given collection
type MongoImpl ¶
type MongoImpl interface { FindOne(collection string, filter interface{}) *mongo.SingleResult Upsert(collection string, filter interface{}, update interface{}) *mongo.SingleResult FindOneAndDelete(collection string, filter interface{}) *mongo.SingleResult Disconnect() error }
MongoImpl defines the interface for interacting with MongoDB
Click to show internal directories.
Click to hide internal directories.