Я пытаюсь написать запрос на шифрование, в котором все время записывается для куба человека.Запрос работает нормально, но я вижу, что если в результатах нет времени (Time) - [: RECORDED_ON] - (Cube), я получаю 1 запись в наборе с обоими значениями null.Кроме того, я хотел бы заказать дату в коллекции времен DESC
Вот мой шифр:
MATCH(a:App{name:'AllAboutCubes'})<-[:MEMBER_OF]-(p:Cuber) WHERE id(p) = 1234
MATCH(p)<-[:BELONGS_TO {is_active:1}]-(c:Cube)
OPTIONAL MATCH (c)-[:TYPE]->(ct:CubeType)
OPTIONAL MATCH (c)<-[:RECORDED_ON]-(t:Time)-[:RECORDED]-(p)
WITH c,ct,COLLECT({time:t.time,date:t.date}) as times
RETURN c.name as name, c.manufacturer as manufacturer, ct.type as type, id(c) as cube_id, times as times
ORDER BY manufacturer ASC
Но я вернусь:
"name" "manufacturer" "type" "cube_id" "times"
"Weipo" "MoYu" "2x2" 7452 [{"time":null,"date":null}]
"GTS3M" "MoYu" "3x3" 7453 [{"time":null,"date":null}]
"MoYu Skewb" "MoYu" "Skewb" 7458 [{"time":"12.435","date":1553880809832}]
"WuQue" "QiYi MoFangGe" "4x4" 7459 [{"time":null,"date":null}]
"Valk 3" "QiYi MoFangGe" "3x3" 7454 [{"time":null,"date":null}]
"Mini Rose Valk 3" "QiYi MoFangGe" "3x3" 7456 [{"time":null,"date":null}]
"Valk 2" "QiYi MoFangGe" "2x2" 7450 [{"time":null,"date":null}]
"ChuWen M" "Supernova" "2x2" 7484 [{"time":null,"date":null}]
"Wingy" "X-Man Designs" "Skewb" 7457 [{"time":"12.255","date":1553881012244},{"time":"13.49","date":1553212800000}]
"Bell" "X-Man Designs" "Pyraminx" 7478 [{"time":"9.234","date":1553817600000}]
"Ruipo" "YJ" "2x2" 7451 [{"time":null,"date":null}]
"Little Magic" "YuXin" "3x3" 7455 [{"time":null,"date":null}]
, к которомуЯ не хочу, чтобы [{"time": null, "date": null}]
Есть идеи?Спасибо и дайте мне знать!