Documentation
¶
Index ¶
- type Mgo
- type MongoTemplate
- func (t *MongoTemplate) Delete(filter bson.D) (interface{}, error)
- func (t *MongoTemplate) Expire() (interface{}, error)
- func (t *MongoTemplate) GetCollection() *mongo.Collection
- func (t *MongoTemplate) Insert(document interface{}) (interface{}, error)
- func (t *MongoTemplate) Query(filter bson.D) *mongo.SingleResult
- func (t *MongoTemplate) Update(filter bson.D, update bson.D) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoTemplate ¶
type MongoTemplate struct {
// contains filtered or unexported fields
}
func NewMongoTemplate ¶
func NewMongoTemplate(mgo *Mgo) *MongoTemplate
func (*MongoTemplate) Delete ¶
func (t *MongoTemplate) Delete(filter bson.D) (interface{}, error)
*
- 删除数据
func (*MongoTemplate) GetCollection ¶
func (t *MongoTemplate) GetCollection() *mongo.Collection
func (*MongoTemplate) Insert ¶
func (t *MongoTemplate) Insert(document interface{}) (interface{}, error)
*
- 插入数据
func (*MongoTemplate) Query ¶
func (t *MongoTemplate) Query(filter bson.D) *mongo.SingleResult
*
- 查询单条数据
Click to show internal directories.
Click to hide internal directories.