【发布时间】:2018-03-05 17:51:17
【问题描述】:
我正在使用 Neo4j dB 并使用模式理解来返回值。我有两种类型的人和朋友: (p:Person)-[:FRIEND_WITH]->(f:Friend)
Type Person{
id: String
name: String
friends: [Friend]
}
Type Friend{
id: String
name: String
}
type Query {
persons( limit:Int = 10): [Person]
friends( limit:Int = 10): [Friend]
}
我想要做的是在“persons”查询执行时按升序拉取字段 friends 的数组列表(存在于 Person Type 中)。例如
{
"data": {
"persons": {
"id": "1",
"name": "Timothy",
"friends": [
{
"id": "c3ef473",
"name": "Adam",
},
{
"id": "ef4e373",
"name": "Bryan",
},
(
"id": "e373ln45",
"name": "Craig",
},
我应该怎么做?我研究了排序,但是当我们在 neo4j 中使用模式理解时,我没有发现任何关于数组对象排序的具体内容。任何建议都会非常有帮助!
【问题讨论】: