i 我的测试收集如下。
> db.test.find()
{ "_id" : "111-21212121", "Mawb" : "111-1111111", "Hawb" : "111111", "Hawb_date" : "date1" }
{ "_id" : "111-21212122", "Mawb" : "111-1111111", "Hawb" : "222222", "Hawb_date" : "date1" }
{ "_id" : "111-21212123", "Mawb" : "222-2222222", "Hawb" : "333333", "Hawb_date" : "date1" }
{ "_id" : "111-21212124", "Mawb" : "222-2222222", "Hawb" : "444444", "Hawb_date" : "date1" }
{ "_id" : "111-21212125", "Mawb" : "333-3333333", "Hawb" : "555555", "Hawb_date" : "date1" }
{ "_id" : "111-21212126", "Mawb" : "333-3333333", "Hawb" : "666666", "Hawb_date" : "date1" }
and i want to group(map/combine) it by "Mawb" key... so that i can have output of grouped document like,
[
{ "_id" : "111-21212121", "Mawb" : "111-1111111", "Hawb" : "111111", "Hawb_date" : "date1" }
{ "_id" : "111-21212122", "Mawb" : "111-1111111", "Hawb" : "222222", "Hawb_date" : "date1" }],
[{ "_id" : "111-21212123", "Mawb" : "222-2222222", "Hawb" : "333333", "Hawb_date" : "date1" }
{ "_id" : "111-21212124", "Mawb" : "222-2222222", "Hawb" : "444444", "Hawb_date" : "date1" }],
[{ "_id" : "111-21212125", "Mawb" : "333-3333333", "Hawb" : "555555", "Hawb_date" : "date1" }
{ "_id" : "111-21212126", "Mawb" : "333-3333333", "Hawb" : "666666", "Hawb_date" : "date1" }]
我试图绘制一个地图,但不能通过地图。 如何做到这一点?