Documentation ¶
Index ¶
- type Client
- func (db *Client) Aggregate(collection string, pipeline interface{}) (*mongo.Cursor, error)
- func (db *Client) Find(collection string, filters *bson.M, pagination pagination.Query) (*mongo.Cursor, error)
- func (db *Client) FindOne(collection string, filters *bson.M) *mongo.SingleResult
- func (db *Client) FindOneAndUpdate(collection string, filters *bson.M, document *bson.M) *mongo.SingleResult
- func (db *Client) InsertOne(collection string, document *bson.M) (*mongo.InsertOneResult, error)
- func (db *Client) InsertOneIfNotExist(collection string, filters *bson.M, document *bson.M) (*mongo.InsertOneResult, error)
- type ClientOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client - MongodbClient struct
func NewClient ¶
func NewClient(clientOptions *ClientOptions) (*Client, error)
NewClient - New Mongodb Client
func (*Client) Find ¶
func (db *Client) Find(collection string, filters *bson.M, pagination pagination.Query) (*mongo.Cursor, error)
Find - find all documents
func (*Client) FindOneAndUpdate ¶
func (db *Client) FindOneAndUpdate(collection string, filters *bson.M, document *bson.M) *mongo.SingleResult
FindOneAndUpdate - find one document and update
type ClientOptions ¶
ClientOptions - Mongodb Client Options
Click to show internal directories.
Click to hide internal directories.