0
考慮下面的結果在我的暗號查詢,那裏的人都集合:暗號聚集和收集
[
{
"people": [
{
"id": 24749,
"matches": 1
},
{
"id": 26026,
"matches": 1
},
{
"id": 26223,
"matches": 1
},
{
"id": 25121,
"matches": 1
},
{
"id": 24632,
"matches": 1
},
{
"id": 25708,
"matches": 1
},
{
"id": 25182,
"matches": 1
},
{
"id": 24826,
"matches": 1
},
{
"id": 26186,
"matches": 1
},
{
"id": 27001,
"matches": 1
},
{
"id": 24243,
"matches": 1
},
{
"id": 27255,
"matches": 1
},
{
"id": 27145,
"matches": 1
},
{
"id": 24126,
"matches": 1
},
{
"id": 27463,
"matches": 1
},
{
"id": 24069,
"matches": 1
},
{
"id": 25210,
"matches": 1
},
{
"id": 24994,
"matches": 1
},
{
"id": 27331,
"matches": 1
},
{
"id": 25793,
"matches": 1
},
{
"id": 27312,
"matches": 1
},
{
"id": 26206,
"matches": 1
},
{
"id": 24252,
"matches": 1
},
{
"id": 24714,
"matches": 2
},
{
"id": 24612,
"matches": 1
},
{
"id": 26964,
"matches": 1
},
{
"id": 27101,
"matches": 1
},
{
"id": 26730,
"matches": 1
},
{
"id": 27211,
"matches": 1
},
{
"id": 24783,
"matches": 2
},
{
"id": 25336,
"matches": 1
},
{
"id": 24128,
"matches": 1
},
{
"id": 26186,
"matches": 1
},
{
"id": 25125,
"matches": 2
},
{
"id": 24069,
"matches": 3
},
{
"id": 24607,
"matches": 1
},
{
"id": 27055,
"matches": 1
},
{
"id": 25336,
"matches": 3
},
{
"id": 24128,
"matches": 2
},
{
"id": 26716,
"matches": 1
},
{
"id": 27331,
"matches": 1
},
{
"id": 24069,
"matches": 1
}
]
}
]
我(與CYPHER)如何可以遍歷人們收集信息,發現相同的「ID」的那些,將「匹配」項目加在一起,然後添加一個名爲「重複」或類似的新項目。
實例結果我試圖讓:
[
{
"people": [
{
"id": 24069,
"matches": 5, // all the "matches" of the duplicate 24069's added together
"duplicates": 3 // how may times the id 24069 was found in the collection called people
},
// etc...
]
}
]
什麼是您當前的密碼查詢? – 2014-09-22 11:14:08