Documentation ¶
Index ¶
- type Connect
- func (conn *Connect) CreateDocument(collectionName string, props interface{}) error
- func (conn *Connect) DeleteByID(collectionName string, id string) (deleteCount int64, err error)
- func (conn *Connect) FindByID(collectionName string, ID string) (result bson.M, err error)
- func (conn *Connect) FindOne(collectionName string, q interface{}) (result bson.M, err error)
- func (conn *Connect) Search(collectionName string, q interface{}, skip int, limit int) (searchResults []bson.M, err error)
- func (conn *Connect) UpdateDocByID(collection string, id string, data interface{}) (updatedDoc bson.M, err error)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connect ¶
type Connect struct {
// contains filtered or unexported fields
}
Connect used to initialize the connection.
func NewConnection ¶
NewConnection function used to initialize the connection client.
func (*Connect) CreateDocument ¶
CreateDocument function was create the new document record in given collection.
func (*Connect) DeleteByID ¶ added in v1.0.2
DeleteByID function was delete the document record from given collection.
func (*Connect) FindByID ¶ added in v1.0.2
FindByID function find the first matching document in collection based on given ID.
func (*Connect) FindOne ¶
FindOne function find the first matching document in collection based on given query.
type Options ¶ added in v1.0.4
type Options func(c *Connect)
Options the self referenceing function to set the config
func WithDatabase ¶ added in v1.0.5
WithDatabase self referenceing function to set the database name.
func WithLogLevel ¶ added in v1.0.4
WithLogLevel self referenceing function to set the log level for the logrus.