I am trying to display the total registered users in the admin panel.
Below is my code to get the total count
exports.getcount = async (req, res) => {
Client.count({}, function (err, count) {
console.log("Number of users:", count);
res.status(200).json({
message: `Registered Clients ${count}`,
});
});
};
In my client schema, I have an isDeleted field that is either true or false. In my total count, I just want to return those clients which contain isDeleted:false
.