本文整理汇总了Python中neo4jrestclient.client.GraphDatabase.flush方法的典型用法代码示例。如果您正苦于以下问题:Python GraphDatabase.flush方法的具体用法?Python GraphDatabase.flush怎么用?Python GraphDatabase.flush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neo4jrestclient.client.GraphDatabase
的用法示例。
在下文中一共展示了GraphDatabase.flush方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createNewUserNode
# 需要导入模块: from neo4jrestclient.client import GraphDatabase [as 别名]
# 或者: from neo4jrestclient.client.GraphDatabase import flush [as 别名]
def createNewUserNode(self,userData):
sts = self.checkUserExists(userData['email'])
Id=0
if sts == False:
try: #user details
username=userData['username']
password =userData['password']
email =userData['email']
firstName =userData['firstName']
lastName =userData['lastName']
phone = userData['phone']
address = userData['address']
postal =userData['postal']
state=userData['state']
Id=int(self.getNewUserId())
#Graph database config
elements=[]
conf= DBConf.DBConf()
elements =conf.getNeo4jConfig()
dbUrl = elements[0]
dbUser = elements[1]
dbPass = elements[2]
db =GraphDatabase(dbUrl,dbUser,dbPass)
user = db.labels.create("User")
prop = db.nodes.create(userId=str(Id),username=username,password=password,email=email,firstName=firstName,lastName=lastName,phone=phone,state=state,address=address,postal=postal,cat1=0,cat2=0,cat3=0,cat4=0,cat5=0,cat6=0,cat7=0,cat8=0)
user.add(prop)
db.flush(True)
except Exception:return 0
finally:return Id
else : return -1