拥有这种格式的文档:
"_id" : ObjectId("59ce3bb32708c95ee2168e2f"),
"document1" : [
{
"value" : "doc1A"
},
{
"value" : "doc1B"
},
{
"value" : "doc1C"
},
{
"value" : "doc1D"
},
{
"value" : "doc1E"
},
{
"value" : "doc1F"
}
],
"document2" : [
{
"value" : "doc2A"
},
{
"value" : "doc2B"
},
{
"value" : "doc2C"
},
{
"value" : "doc2D"
},
"metric1" :0.0,
"metric2" : 0.0
]
}
我需要通过document1和document 2值的连接进行分组,并在Java的Aggregation框架中对其执行一些计算。
我可以进行分组(document1,document2)但我会将_id作为一个数组获取,所以我希望将它作为连接并作为:
doc1A (doc2A) / doc1A (doc2B) / doc1A (doc2C) ...
你有什么想法吗?