MongoDB uses group by and displays other column max values
The following script implements the function of duplicating the word_info table through the word field and writing it to the word_info_new table
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}))