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