有没有控制属性顺序的机制?
我无法在http://www.neo4j.org/console中重现此内容
如果我执行以下操作,请使用 Neo4j 1.9.2 社区:
CREATE (m1 {`$type`: {moduleTypeName}, Name: 'M1', ModelNumber: 'MN1'})
然后稍后我使用我返回的 REST 密码端点从密码查询中取回这个节点......
{
"extensions": {},
"paged_traverse": "http://localhost:7575/db/data/node/3777/paged/traverse/{returnType}{?pageSize,leaseTime}",
"outgoing_relationships": "http://localhost:7575/db/data/node/3777/relationships/out",
"traverse": "http://localhost:7575/db/data/node/3777/traverse/{returnType}",
"all_typed_relationships": "http://localhost:7575/db/data/node/3777/relationships/all/{-list|&|types}",
"property": "http://localhost:7575/db/data/node/3777/properties/{key}",
"all_relationships": "http://localhost:7575/db/data/node/3777/relationships/all",
"self": "http://localhost:7575/db/data/node/3777",
"properties": "http://localhost:7575/db/data/node/3777/properties",
"outgoing_typed_relationships": "http://localhost:7575/db/data/node/3777/relationships/out/{-list|&|types}",
"incoming_relationships": "http://localhost:7575/db/data/node/3777/relationships/in",
"incoming_typed_relationships": "http://localhost:7575/db/data/node/3777/relationships/in/{-list|&|types}",
"create_relationship": "http://localhost:7575/db/data/node/3777/relationships",
"data": {
"ModelNumber": "MN1",
"$type": "ModuleType",
"Name": "M1"
}
}
我正在使用http://james.newtonking.com/pages/json-net.aspx来解析 JSON 并让它自动推断对象类型,$type 属性必须是第一个。当您不想先将整个内容加载到内存中时,在流中解析 JSON 是有意义的。
它似乎不是按字母顺序排列的,也不是随机的。似乎顺序对于不同的对象类型是一致的,但它们之间却不一致。
我也将节点拉到了 Shell 中,因此似乎顺序不取决于我如何获取节点,但也与我创建节点的顺序无关。