i want to sort for data in a collection using the findById and populate the result that the code i have written doest work , it worked for only find method but not findById.
my model
const mongoose = require("mongoose");
const jobModel = mongoose.Schema(
{
title: {
type: String,
},
description: {
type: String,
},
cost: {
type: Number,
},
timeFrame: {
type: String,
},
accept: {
type: Boolean,
},
seen: {
type: Boolean,
},
status: {
type: String,
},
member: {
type: mongoose.Schema.Types.ObjectId,
ref: "members",
},
client: {
type: mongoose.Schema.Types.ObjectId,
ref: "clients",
},
like: [
{
type: mongoose.Schema.Types.ObjectId,
ref: "likes",
},
],
},
{ timestamps: true }
);
module.exports = mongoose.model("jobs", jobModel);
my handler