Documentation ¶
Index ¶
- Variables
- func IsExist() bool
- func Recover() error
- func Remove() error
- type Client
- func (c *Client) Aggregate(name string, groupStage mongo.Pipeline) ([]bson.M, error)
- func (c *Client) DeleteOne(name string, filter interface{}) error
- func (c *Client) Disconnect() error
- func (c *Client) Find(name string, filters ...interface{}) ([]bson.M, error)
- func (c *Client) FindOne(name string, filter interface{}) *mongo.SingleResult
- func (c *Client) InsertOne(name string, filter interface{}) (interface{}, error)
- func (c *Client) Ping() error
- func (c *Client) UpdateOne(name string, filter, update interface{}) (*mongo.UpdateResult, error)
- type MongoDB
Constants ¶
This section is empty.
Variables ¶
View Source
var CONFIG = MongoDB{
DB: "mongo_test",
Timeout: 10,
Addr: "localhost:27017",
}
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) FindOne ¶
func (c *Client) FindOne(name string, filter interface{}) *mongo.SingleResult
FindOne
Click to show internal directories.
Click to hide internal directories.