Mongodb 连接嵌套在另一个数组中的数组中的数组
在不讨论我是如何到达这里的情况下,有人能帮助我使用mongo中的聚合连接这些嵌套数组的内容吗: 连接Mongodb 连接嵌套在另一个数组中的数组中的数组,mongodb,mongodb-query,mongodb-aggregation,Mongodb,Mongodb Query,Mongodb Aggregation,在不讨论我是如何到达这里的情况下,有人能帮助我使用mongo中的聚合连接这些嵌套数组的内容吗: 连接 { "missing_users" : [ [ [ "attachment_5089820813-30177-ulr2vz.csv", "User not found for 201610-EEC-100-A01-31562"
{ "missing_users" : [
[
[
"attachment_5089820813-30177-ulr2vz.csv",
"User not found for 201610-EEC-100-A01-31562"
],
[
"attachment_50820160813-30177-ulr2vz.csv",
"User not found for 201610-EEC-001-001-31567"
],
[
"attachment_5089820813-30177-ulr2vz.csv",
"User not found for 201610-EEC-001-001-31547)"
],
],
[
[
"attachment_508160813-28337-5qpqyb.csv",
"User not found for 201610-ETX-010-001-33550)"
],
[
"attachment_50520160813-28337-5qpqyb.csv",
"User not found for 201610-ETX-010-001-33330)"
],
[
"attachment_50895813-28337-5qpqyb.csv",
"User not found for 201610-ETX-010-001-33580)"
],
[
"attachment_50813-28337-5qpqyb.csv",
"User not found for 201610-ETX-010-001-33450)"
],
[
"attachment_508916813-28337-5qpqyb.csv",
"User not found for 201610-ETX-010-001-33550)"
]
]
]
}
我很乐意在深度嵌套数组中找到一个字符串数组,但我也只对最深度嵌套数组的第二个值感兴趣
这就足够了:
results : ["attachment_5089820813-30177-ulr2vz.csv",
"User not found for 201610-EEC-100-A01-31562",
"attachment_5089820813-30177-ulr2vz.csv",
"User not found for 201610-EEC-100-A01-31562",
"attachment_5089820813-30177-ulr2vz.csv",
"User not found for 201610-EEC-100-A01-31562"]
但我真的只想要这个:
results : ["User not found for 201610-EEC-100-A01-31762",
"User not found for 201610-EEC-100-A01-31862",
"User not found for 201610-EEC-100-A01-35602"]
我正试着。。下面的方法有用吗
s1:PRIMARY> db.ary.aggregate([{"$unwind":"$missing_users"},{"$unwind":"$missing_users"},{"$unwind":"$missing_users"},{"$group":{"_id":"$_id","missing_users":{"$push":"$missing_users"}}}]).pretty();
\输出
{
"_id" : ObjectId("57aead0a4d7aa623b01b5820"),
"missing_users" : [
"attachment_5089820813-30177-ulr2vz.csv",
"User not found for 201610-EEC-100-A01-31562",
"attachment_50820160813-30177-ulr2vz.csv",
"User not found for 201610-EEC-001-001-31567",
"attachment_5089820813-30177-ulr2vz.csv",
"User not found for 201610-EEC-001-001-31547)",
"attachment_508160813-28337-5qpqyb.csv",
"User not found for 201610-ETX-010-001-33550)",
"attachment_50520160813-28337-5qpqyb.csv",
"User not found for 201610-ETX-010-001-33330)",
"attachment_50895813-28337-5qpqyb.csv",
"User not found for 201610-ETX-010-001-33580)",
"attachment_50813-28337-5qpqyb.csv",
"User not found for 201610-ETX-010-001-33450)",
"attachment_508916813-28337-5qpqyb.csv",
"User not found for 201610-ETX-010-001-33550)"
]
}
s1:PRIMARY>
你能粘贴你想要的有用的输出吗