Documentation ¶
Index ¶
- Variables
- func Add(db, col string, obj interface{}, opts ...*options.InsertOneOptions) (id primitive.ObjectID, err error)
- func Aggregate(db, col string, filter interface{}, pointerToSliceResults interface{}, ...) error
- func ClientClose()
- func Delete(db, col string, filter interface{}, opts ...*options.DeleteOptions) error
- func DeleteMany(db, col string, filter interface{}, opts ...*options.DeleteOptions) error
- func Get(db, col string, filter interface{}, result interface{}, ...) error
- func InnitConnection()
- func List(db, col string, filter interface{}, pointerToSliceResults interface{}, ...) error
- func StructToDoc(v interface{}) (doc *bson.D, err error)
- func StructToUnorderedDoc(v interface{}) (doc *bson.M, err error)
- func UpdateMany(db, col string, filter, update interface{}, opts ...*options.UpdateOptions) error
- func UpdateOne(db, col string, filter, update interface{}, opts ...*options.UpdateOptions) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadReq = errors.New("MongoDB Bad request") ClearFilter = bson.D{} ErrNoDocuments = mongo.ErrNoDocuments )
Functions ¶
func Aggregate ¶
func Aggregate(db, col string, filter interface{}, pointerToSliceResults interface{}, opts ...*options.AggregateOptions) error
func DeleteMany ¶
func DeleteMany(db, col string, filter interface{}, opts ...*options.DeleteOptions) error
func Get ¶
func Get(db, col string, filter interface{}, result interface{}, opts ...*options.FindOneOptions) error
func InnitConnection ¶
func InnitConnection()
func List ¶
func List(db, col string, filter interface{}, pointerToSliceResults interface{}, pageNum, limitNum int, opts ...*options.FindOptions) error
type of results must be array of struct
func StructToDoc ¶
func StructToUnorderedDoc ¶
func UpdateMany ¶
func UpdateMany(db, col string, filter, update interface{}, opts ...*options.UpdateOptions) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.