将多个属性的内容更新到节点上

def update_by_id(id,graph,**kwargs):
"""
更新节点的属性
根据节点的ID来更新节点的属性,如果存在该属性,则更新,如果不存在该属性,则添加
"""
if graph is None:
graph = get_graph()
if kwargs is None:
return None
match = "match (x) where id(x)=%s " % (id)
fields_str=''
for k,v in kwargs:
if v is not None:
temp = " set x.%s = '%s' " % (k,v)
fields_str += temp match = match + fields_str
match = match + " return id(x) as x_id"
result = graph.run(match).data()
if result is not None and len(result > 0):
id = result[0]["x_id"]
return id
return None

最新文章

  1. 通过innobackupex实现对MySQL的完整备份与还原
  2. listview侧滑菜单swipemenulistview的简单使用
  3. 调用MyFocus库,简单实现二十几种轮播效果
  4. iOS崩溃调试的使用和技巧总结
  5. Centos7安装配置NFS服务和挂载
  6. WebService 基础使用&cxf第三方Service使用
  7. 创建缓存文件(。php)
  8. Java-在线聊天系统-线程
  9. mars android视频学习笔记一:Activity生命周期
  10. POJ 3468 A Simple Problem with Integers(线段树区间更新,模板题,求区间和)
  11. django1.6之mysql配置
  12. mysql数据库引擎问题汇总
  13. Redis的AOF功能
  14. Java -- sleep and wait
  15. Vue跨门槛系列之实例的阐述
  16. python简单爬虫技术
  17. 关于Net core 的https 设置小知识
  18. linux中的&&,|| 与 () 命令
  19. 驱动调试(三)oops确定函数PC
  20. 主机连接虚拟机redis 服务器

热门文章

  1. 【概率论】4-6:协方差和相关性(Covariance and Correlation)
  2. web软件测试基础系统测试简化理论
  3. luogu2331
  4. Dubbo——基础
  5. C# http请求工具类
  6. Django基础之中间件的执行流程
  7. c++ 容器反转并且拷贝到一个新容器中
  8. layer 漂亮的弹窗
  9. Node解析之----模块机制篇
  10. java网络通信:异步非阻塞I/O (NIO)