在 Neomodel 中,如何在节点对象之间共享唯一索引,而不实例化单独的对象来仅保存索引数据?我想根据索引查询找到对象,例如:
...
mynode = BaseObject.index.get(uid=uid_of_Type1Object)
# mynode is now of type `Type1Object`
和
class BaseObject(StructuredNode):
uid = StringProperty(unique_index=True)
...
class Type1Object(BaseObject):
...
def assign_uid(self, guid):
# I may need tweaking of uid generator
# on subclass level
self.uid = guid
class Type2Object(BaseObject):
...
def assign_uid(self, guid):
self.uid = guid