Documentation ¶
Index ¶
- Constants
- type MongoClient
- func (m *MongoClient) Close()
- func (m *MongoClient) DeleteMany(collection string, filter interface{}) (result int64, err error)
- func (m *MongoClient) DeleteOne(collection string, filter interface{}) (result int64, err error)
- func (m *MongoClient) Find(collection string, filter interface{}, opts ...*options.FindOptions) (result *mongo.Cursor, err error)
- func (m *MongoClient) FindOne(collection string, filter interface{}) (result *mongo.SingleResult, err error)
- func (m *MongoClient) Insert(collection string, data []interface{}) (result []interface{}, err error)
- func (m *MongoClient) Start() error
- func (m *MongoClient) UpdateMany(collection string, data interface{}, filter interface{}) (result interface{}, err error)
- func (m *MongoClient) UpdateOne(collection string, data interface{}, filter interface{}) (result interface{}, err error)
- type MongoConfig
Constants ¶
View Source
const ( MongoCommonCostMax = 20 MongoCmd = "mongo_cmd_%v" MongoCmdSlowCount = "mongo_%v_slow_count" MongoNormalSlowCount = "mongo_common_slow_count" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoClient ¶
type MongoClient struct { DbConfig *MongoConfig `inject:"mongoDbConfig" canNil:"true"` DbConf *ini.File `inject:"mongoDbConf" canNil:"true"` DbConfPath string `inject:"mongoDbConfPath" canNil:"true"` DataBase string `inject:"mongoDatabase" canNil:"true"` // mongodb 实例名 // contains filtered or unexported fields }
func (*MongoClient) Close ¶
func (m *MongoClient) Close()
func (*MongoClient) DeleteMany ¶
func (m *MongoClient) DeleteMany(collection string, filter interface{}) (result int64, err error)
func (*MongoClient) DeleteOne ¶
func (m *MongoClient) DeleteOne(collection string, filter interface{}) (result int64, err error)
func (*MongoClient) Find ¶
func (m *MongoClient) Find(collection string, filter interface{}, opts ...*options.FindOptions) (result *mongo.Cursor, err error)
func (*MongoClient) FindOne ¶
func (m *MongoClient) FindOne(collection string, filter interface{}) (result *mongo.SingleResult, err error)
func (*MongoClient) Insert ¶
func (m *MongoClient) Insert(collection string, data []interface{}) (result []interface{}, err error)
func (*MongoClient) Start ¶
func (m *MongoClient) Start() error
func (*MongoClient) UpdateMany ¶
func (m *MongoClient) UpdateMany(collection string, data interface{}, filter interface{}) (result interface{}, err error)
func (*MongoClient) UpdateOne ¶
func (m *MongoClient) UpdateOne(collection string, data interface{}, filter interface{}) (result interface{}, err error)
Click to show internal directories.
Click to hide internal directories.