- Calculate - Total Ratings Count, Average Ratings.
- List - All Comments and ratings including sorting (on basis of rating) & pagination.
I need help with this. This is how my ratings schema looks.
Need the aggregation logic for this.
I need help with this. This is how my ratings schema looks.
Need the aggregation logic for this.
Hello @Atul_tiwari,
Welcome again to MongoDB Developer Forum,
You could build aggregation pipeline (aggregate()) using below pipeline stages,
You can use $sort for sorting by rating
“List - All Comments” This is little unclear, how you want list of all comments
For more better answer you need to describe your expected result.