使用Neo4j / Ruby,我想得到一个节点的父节点。
#! /bin/sh
for dir in `find . -maxdepth 1 -mindepth 1 -type d | sed 's|./||'`
do
tar -czvf /Users/Me/Documents/$dir.tar.gz /Users/Me/Projects/$dir;
done
答案 0 :(得分:0)
这应该很简单。您可以通过以下几种方式实现:
class Decision
include Neo4j::ActiveNode
# ... properties
has_many :out, :next, rel_class: :Action, model_class: :Decision
# The straightforward way
has_many :in, :parents, rel_class: :Action, model_class: Decision
# Using `origin`
has_many :in, :parents, origin: :next, model_class: :Decision
end
如果您只希望每个has_one
有一个父母,那么该关联也可以很容易Decision