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) Find(coll string, key string, value string) (*mongo.Cursor, error)
- func (dba *Client) FindAll(coll string) (*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) IDFromObjectID(bid interface{}) string
- 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 primitive.ObjectID, data interface{}) (*mongo.UpdateResult, error)
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) FindByID ¶
func (dba *Client) FindByID(coll string, id string) *mongo.SingleResult
FindByID returns all entities of a given collection
func (*Client) IDFromObjectID ¶
IDFromObjectID ...
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 primitive.ObjectID, data interface{}) (*mongo.UpdateResult, error)
UpdateOneByID inserts one document
Click to show internal directories.
Click to hide internal directories.