简体   繁体   English

如何使用 Gremlin 检查图形中是否存在节点/顶点/边

[英]How to check the node/vertex/Edge is present in the Graph using Gremlin

How to check the node/vertex or edge is present in the Graph using the Gremlin query?如何使用Gremlin查询检查Graph中是否存在node/vertexedge

To check the node/Vertex检查节点/顶点

   //Returns True or False
   g.V('id').hasNext()

To check the edge检查边缘

 //Returns True or False
 g.V('id).bothE().hasNext();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何通过gremlin检索在Cassandra中已经创建的(图形)数据库? - How to retrieve already created (graph) database in Cassandra through gremlin? 如何使用实体框架检查数据库中是否已经存在数据 - How to check if data is already present in database using entity framework 如何有效地检查在haskell中使用HDBC是否存在条目? - How to effectively check if an entry is present using HDBC in haskell? 如何在Titan图形数据库中自己设置顶点的索引 - How to set a vertex's Index myself in Titan Graph Database 如何使用rawQuery检查是否存在数据库记录? - How do I check using whether a db record is present using rawQuery? 如何检查值是否存在于多个表中 - How to check whether the value is present in mutiple tables 如何在titan图DB中的顶点属性上执行通配符搜索? - How can I perform a wildcard search on a vertex property in titan graph DB? 如何检查一个节点是否属于树中的另一个节点 - How to check if a node belongs to another node in a tree 从 gremlin 中的图形路径上的所有顶点调用属性 - Calling properties from all vertices on a graph path in gremlin 如何检查非默认端口上存在的 postgres 中的数据库列表? - How to check list of database in postgres present on non default port?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM