本文整理匯總了Golang中github.com/jmcvetta/neoism.Database.CypherBatch方法的典型用法代碼示例。如果您正苦於以下問題:Golang Database.CypherBatch方法的具體用法?Golang Database.CypherBatch怎麽用?Golang Database.CypherBatch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/jmcvetta/neoism.Database
的用法示例。
在下文中一共展示了Database.CypherBatch方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: cleanupConstraints
func cleanupConstraints(t *testing.T, db *neoism.Database) {
err := db.CypherBatch([]*neoism.CypherQuery{
&neoism.CypherQuery{
Statement: `DROP CONSTRAINT ON (x:NeoUtilsTest) ASSERT x.name IS UNIQUE`,
},
})
if err != nil {
t.Fatal(err)
}
}
示例2: cleanup
func cleanup(t *testing.T, db *neoism.Database) {
err := db.CypherBatch([]*neoism.CypherQuery{
&neoism.CypherQuery{
Statement: `MATCH (x:NeoUtilsTest) DETACH DELETE x`,
},
})
if err != nil {
t.Fatal(err)
}
}
示例3: cleanup
func cleanup(db *neoism.Database) {
qs := []*neoism.CypherQuery{
&neoism.CypherQuery{
Statement: `START r=rel(*) DELETE r`,
},
&neoism.CypherQuery{
Statement: `START n=node(*) DELETE n`,
},
}
err := db.CypherBatch(qs)
if err != nil {
log.Fatal(err)
}
}