How to group records based on array elements using MongoDB
问题 I have a data collection which contains a set of records in the following format. { "_id" : 22, "title" : "3D User Interfaces with Java 3D", "isbn" : "1884777902", "pageCount" : 520, "publishedDate" : ISODate("2000-08-01T07:00:00Z"), "thumbnailUrl" : "https://s3.amazonaws.com/AKIAJC5RLADLUMVRPFDQ.book-thumb-images/barrilleaux.jpg", "longDescription" : "Description", "status" : "PUBLISH", "authors" : [ "Jon Barrilleaux" ], "categories" : [ "Java", "Computer Graphics" ] }, { "_id" : 23, "title"