Documentation
¶
Index ¶
Constants ¶
View Source
const ( Equal = "Equal" LessThan = "LessThan" LessThanEqual = "LessThanEqual" GreaterThan = "GreaterThan" GreaterThanEqual = "GreaterThanEqual" Descending = "Descending" Ascending = "Ascending" )
View Source
const (
ErrDuplicateCode = 11000
)
Variables ¶
This section is empty.
Functions ¶
func IsDuplicate ¶
IsDuplicate check error from mongo if error because duplicated record
func IsInvalidIndexValue ¶
IsInvalidIndexValue check error from mongo if error because invalid index value
func TranslateQuery ¶
func TranslateQuery(query *Query) (bson.D, *options.FindOptions)
TranslateQuery struct to mongo bson
Types ¶
type Config ¶
type Config struct { Address string Username string Password string Database string MaxPoolSize int }
Config struct to create new mongo db connection client
{ Address: the URI of mongo db (mongodb://localhost:27017) Username: the username for authentication. Password: the password for authentication. Database: the name of the database to use for authentication. MaxPoolSize: specifies that maximum number of connections allowed in the driver's connection pool to each server. }
Click to show internal directories.
Click to hide internal directories.