{ public void map(Object key, BSONObject doc, Context context) { List<String> genres = (List<String>)doc.get("genres"); for(String genre : genres) { context.write(new Text(genre), new IntWritable(1)); } } } { _id: ObjectId(…), title: “Toy Story”, genres: [“Animation”, “Children”] } { _id: ObjectId(…), title: “Goldeneye”, genres: [“Action”, “Crime”, “Thriller”] } { _id: ObjectId(…), title: “Jumanji”, genres: [“Adventure”, “Children”, “Fantasy”] }