내가 힘든 시간을 두 개의 다른 소스에서 데이터를 수집하고 마지막 하나는 'dateCreated'으로 정렬 개체의 집합이되도록 컬렉션을 병합하는 데 문제가 있습니다.Neo4j 사이퍼 쿼리와 BY 사용하여 ORDER COLLECT (S)
상황
사용자 그룹에 질문을 할 수 있습니다. 질문은 일반적인 것이거나 특정 비디오 게임과 관련된 것일 수 있습니다. 그룹에서 질문하는 질문이 비디오 게임과 관련된 경우이 질문은 비디오 게임의 질문 페이지에도 나타납니다.
현재 두 가지 일반적인 질문과 하나의 비디오 게임에 대한 질문이 있습니다. 따라서 질문을 가져올 때 3 가지 질문이 있어야합니다.
START group = node(627)
MATCH generalQuestions-[?:GENERAL_QUESTION]->group
WITH group, generalQuestions
MATCH gamesQuestions-[?:GAME_QUESTION]->games<-[:GAMES]-group
WITH (collect(generalQuestions) + collect(gamesQuestions)) as questions
RETURN questions
ORDER BY questions.dateCreated
첫 번째 문제 : 사용 ORDER 내가 할 노력하고있어 달성하는 적절한 방법은 무엇
Cached(questions of type Collection) expected to be of type Map but it is of type Collection - maybe aggregation removed it?
BY 다음은 쿼리
는 쿼리의 ?
두 번째 문제 :
[
Node[641]{dateCreated:1380892636,dateUpdated:1380892636,title:"GENERAL TITLE 1",type:1,content:"GENERAL CONTENT 1"},
Node[641]{dateCreated:1380892636,dateUpdated:1380892636,title:"GENERAL TITLE 1",type:1,content:"GENERAL CONTENT 1"},
Node[641]{dateCreated:1380892636,dateUpdated:1380892636,title:"GENERAL TITLE 1",type:1,content:"GENERAL CONTENT 1"},
Node[641]{dateCreated:1380892636,dateUpdated:1380892636,title:"GENERAL TITLE 1",type:1,content:"GENERAL CONTENT 1"},
Node[641]{dateCreated:1380892636,dateUpdated:1380892636,title:"GENERAL TITLE 1",type:1,content:"GENERAL CONTENT 1"},
Node[641]{dateCreated:1380892636,dateUpdated:1380892636,title:"GENERAL TITLE 1",type:1,content:"GENERAL CONTENT 1"},
Node[642]{dateCreated:1380892642,dateUpdated:1380892642,title:"GENERAL TITLE 2",type:1,content:"GENERAL CONTENT 2"},
Node[642]{dateCreated:1380892642,dateUpdated:1380892642,title:"GENERAL TITLE 2",type:1,content:"GENERAL CONTENT 2"},
Node[642]{dateCreated:1380892642,dateUpdated:1380892642,title:"GENERAL TITLE 2",type:1,content:"GENERAL CONTENT 2"},
Node[642]{dateCreated:1380892642,dateUpdated:1380892642,title:"GENERAL TITLE 2",type:1,content:"GENERAL CONTENT 2"},
Node[642]{dateCreated:1380892642,dateUpdated:1380892642,title:"GENERAL TITLE 2",type:1,content:"GENERAL CONTENT 2"},
Node[642]{dateCreated:1380892642,dateUpdated:1380892642,title:"GENERAL TITLE 2",type:1,content:"GENERAL CONTENT 2"},
Node[632]{dateCreated:1380889484,dateUpdated:1380889484,title:"GTA5 TITLE",type:2,content:"GTA5 CONTENT"},
Node[632]{dateCreated:1380889484,dateUpdated:1380889484,title:"GTA5 TITLE",type:2,content:"GTA5 CONTENT"}
]
이 방법에 문제가 : 잘못된 결과
내가 대신 3 개 결과를 필요없이, ORDER BY 절을 제거하면, 나는 ... 14 얻을 결과를 수집합니까?
편집
gamesQuestion를 얻기 위해 쿼리를 확장 : 당신의 도움에 대한
gamesQuestions-[:GAME_QUESTION]->()<-[:QUESTIONS]-games-[:INTERESTS]->()<-[:HAS_INTEREST_FOR]-interests<-[:INTERESTS]-group
감사합니다 "에 의해 주문"
리사, 대답 해줘서 고마워! 주문 이유를 사용할 수없는 이유를 알고 있습니다. 게임 질문 - [?: GAME_QUESTION] -> 게임 <- [: 게임] - 그룹 대신 게임 질문 - [: GAME_QUESTION] ->() <- [: 질문] - 게임 - [: 관심사] ->() <- [: HAS_INTEREST_FOR] - 관심사 <- [: 관심사] - 그룹 (이번에는 그룹이 토론 한 게임에 대한 모든 질문을 얻는 것입니다. 행 또는 열과 같은 방식으로 일반적인 질문과 게임 관련 질문을 모두 검색 할 수 있는지 알고 싶습니까? – Brice
확장 된 문제를 해결하기위한 답을 업데이트했습니다. –
리사 감사합니다. :) – Brice