时间:2021-07-01 10:21:17 帮助过:6人阅读
db.word_info.aggregate([
{$group:
{ _id:"$word" ,
meaning:{$max:"$meaning"},
usphonetic:{$max:"$usphonetic"}
}
}]).forEach(
function(dc){
db.word_info_new.insert(
{"word":dc._id,
"meaning":dc.meaning,
"usphonetic":dc.usphonetic
}
)}
);
MongoDB 使用group by 并显示其他列max值
标签:gate hone max mon _id phone insert mongo 通过