I want to search for current month that is in sort->personSorter->createdAt. My shcema is
{
link: {
type: String,
default: "",
},
sort: {
personSorter: [
{
userId: {
type: mongoose.Schema.Types.ObjectId,
ref: "users",
},
createdAt: {
type: Date,
default: Date.now(),
},
},
]
},
},
{ timestamps: true }
);