func Destroy(col *mgo.Collection, key int) error {
	return col.Remove(bson.M{keyfield: key})
}
Exemple #2
0
func (executor *OpsExecutor) ExecRemove(
	content Document, coll *mgo.Collection) error {
	return coll.Remove(content["query"])
}
Exemple #3
0
func DeleteByIdAndUserId2(collection *mgo.Collection, id, userId bson.ObjectId) bool {
	err := collection.Remove(GetIdAndUserIdBsonQ(id, userId))
	return Err(err)
}
Exemple #4
0
func DeleteByIdAndUserId(collection *mgo.Collection, id, userId string) bool {
	err := collection.Remove(GetIdAndUserIdQ(id, userId))
	return Err(err)
}
Exemple #5
0
// 删除一条
func Delete(collection *mgo.Collection, q interface{}) bool {
	err := collection.Remove(q)
	return Err(err)
}
Exemple #6
0
// Remove Account into Mongo
func remove(u Account, s *mgo.Collection) {
	err := s.Remove(&u)
	if err != nil {
		panic(err)
	}
}