コード例 #1
0
ファイル: database_test.go プロジェクト: voutasaurus/metamark
func Destroy(col *mgo.Collection, key int) error {
	return col.Remove(bson.M{keyfield: key})
}
コード例 #2
0
ファイル: ops_executor.go プロジェクト: rzh/flashback
func (executor *OpsExecutor) ExecRemove(
	content Document, coll *mgo.Collection) error {
	return coll.Remove(content["query"])
}
コード例 #3
0
ファイル: Mgo.go プロジェクト: kevinhuo88888/leanote
func DeleteByIdAndUserId2(collection *mgo.Collection, id, userId bson.ObjectId) bool {
	err := collection.Remove(GetIdAndUserIdBsonQ(id, userId))
	return Err(err)
}
コード例 #4
0
ファイル: Mgo.go プロジェクト: kevinhuo88888/leanote
func DeleteByIdAndUserId(collection *mgo.Collection, id, userId string) bool {
	err := collection.Remove(GetIdAndUserIdQ(id, userId))
	return Err(err)
}
コード例 #5
0
ファイル: Mgo.go プロジェクト: kevinhuo88888/leanote
// 删除一条
func Delete(collection *mgo.Collection, q interface{}) bool {
	err := collection.Remove(q)
	return Err(err)
}
コード例 #6
0
ファイル: account.go プロジェクト: rcijov/go
// Remove Account into Mongo
func remove(u Account, s *mgo.Collection) {
	err := s.Remove(&u)
	if err != nil {
		panic(err)
	}
}