1
私は、ユーザー、ニュース、およびユーザーニュースのコレクションを持っています。 "user"と "news"に "user-news"人口統計データをソートし、人口統計フィールドで文書を検索
「user-news」のドキュメントを「user.name」または「news.title」でソートして検索することはできますか?
const usersSchema = new Schema({ name: String })
const newsSchema = new Schema({ title: String }),
UsersNewsModel.find(queryObj)
.populate('user', 'name')
.populate('news', 'title')
.sort({ 'user.name': -1 })
.exec((findError, records) => {...}