Documentation ¶
Index ¶
- type Client
- func (dba *Client) C(coll string) *mongo.Collection
- func (dba *Client) Close() error
- func (dba *Client) Connect(host string)
- func (dba *Client) Delete(coll string, key string, value string) (*mongo.DeleteResult, error)
- func (dba *Client) DeleteAll(coll string) (*mongo.DeleteResult, error)
- func (dba *Client) DeleteByID(coll string, id string) (*mongo.DeleteResult, error)
- func (dba *Client) Drop(coll string) error
- func (dba *Client) Find(coll string, key string, value string) (*mongo.Cursor, error)
- func (dba *Client) FindAll(coll string) (*mongo.Cursor, error)
- func (dba *Client) FindAllWithParams(coll string, params *QueryParams) (*mongo.Cursor, error)
- func (dba *Client) FindByID(coll string, id string) *mongo.SingleResult
- func (dba *Client) FindOne(coll string, key string, value string) *mongo.SingleResult
- func (dba *Client) InsertOne(coll string, data interface{}) (*mongo.InsertOneResult, error)
- func (dba *Client) UpdateOne(coll string, key string, value string, data interface{}) (*mongo.UpdateResult, error)
- func (dba *Client) UpdateOneByID(coll string, id string, data interface{}) (*mongo.UpdateResult, error)
- type QueryParam
- type QueryParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client database
func (*Client) C ¶
func (dba *Client) C(coll string) *mongo.Collection
C opens a given collection in the xdcc database
func (*Client) DeleteAll ¶
func (dba *Client) DeleteAll(coll string) (*mongo.DeleteResult, error)
DeleteAll returns all entities of a given collection
func (*Client) DeleteByID ¶
DeleteByID returns all entities of a given collection
func (*Client) FindAllWithParams ¶
FindAllWithParams returns all entities of a given collection
func (*Client) FindByID ¶
func (dba *Client) FindByID(coll string, id string) *mongo.SingleResult
FindByID returns all entities of a given collection
func (*Client) InsertOne ¶
func (dba *Client) InsertOne(coll string, data interface{}) (*mongo.InsertOneResult, error)
InsertOne inserts one document
func (*Client) UpdateOne ¶
func (dba *Client) UpdateOne(coll string, key string, value string, data interface{}) (*mongo.UpdateResult, error)
UpdateOne inserts one document
func (*Client) UpdateOneByID ¶
func (dba *Client) UpdateOneByID(coll string, id string, data interface{}) (*mongo.UpdateResult, error)
UpdateOneByID inserts one document
type QueryParams ¶
type QueryParams struct {
// contains filtered or unexported fields
}
QueryParams ...
func NewQueryParams ¶
func NewQueryParams(queryParams ...QueryParam) *QueryParams
NewQueryParams ...
Click to show internal directories.
Click to hide internal directories.