我在按属性查找顶点时遇到问题。
在他引用的文档中:
这将返回所有具有“name”属性的顶点,其值为“James”:g.vertices.index.lookup vertices = (name = "James")。
我创建了一个名为 Product 的模型:
from bulbs.titan import Graph as Rexter
from bulbs.model import Node, NodeProxy, Relationship, build_data
from bulbs.property import String, Integer, DateTime
from bulbs.utils import current_datetime
# Nodes
class Product(Node):
element_type = "product"
name = String(nullable=False)
pid = Integer(nullable=False, indexed=True)
view_count = Integer(default=0, nullable=False)
created = DateTime(default=current_datetime, nullable=False)
并添加一些信息。
当我运行g.vertices.index.lookup(pid =318)
返回如下:
GET url: http://localhost:8182/graphs/graph/vertices?value=318&key=pid
GET body: None
如果我在 Gremlin 中运行g.V('pid', 318).map()
它会返回:
== > { created = 1437049813 , name = Gladiator (2000 ) , pid = 3578 , ELEMENT_TYPE = product, view_count = 0}
为什么我不能通过 Bulbs 获得顶点?
谢谢!