0
私は別のコレクションに格納されているaccountActiveDate
に基づいてユーザーのリストを返そうとしています。私がconsole.log candidateUserIDByDateを指定した場合、ユーザーは正しい順序で返されますが、ソートされていないvar candidateUserIDByDateを使用してMeteor.users.findを返します。別のコレクションの日付を使用してユーザーを並べ替え
パス:
テンプレートヘルパー:sort.js
let sortCandidatesByDate = CandidateAccountStatus.find({}, {sort: {accountActiveDate: 1}}).fetch();
let candidateUserIDByDate = _.map(sortCandidatesByDate, function(obj) {
return obj.candidateUserId;
});
return Meteor.users.find({$and: [{_id: { $ne: Meteor.userId() }}, {_id: { $in: candidateUserIDByDate }}]});