Want to sort after populate

Populate fields type in Intger.

const UserSchema = new Schema(
{
email: {
type: String,
required: true,
lowercase: true,
trim: true,
minlength: 6,
maxlength: 40,
},
password: { type: String, required: true },
});

UserSchema.virtual(“followers”, {
ref: “Follow”,
localField: “_id”,
foreignField: “following”,
count: true, // Only get the number of docs !!important
});

UserSchema.virtual(“history”, {
ref: “History”,
localField: “_id”,
foreignField: “user”,
count: true, // Only get the number of docs !!important
});

I am trying like this but not working properly.

leaderboard({ offset, limit }) {
return this.model
.find()
.populate({ path: “followers” })
.populate({ path: “history” })
.sort({ followers: “asc”, history: “desc” })
.skip(offset)
.limit(limit)
.exec();
}

not working as expected.