Mongodb – how to sort by an auto-calculated field in mongoose.js
i have a product schema in my project, users can rate the products..the way i set the schema up is to store the number and sum of user ratings, then have a rating field where i would calculate the average…