Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. PaymentModle.aggregate(
  2.                 [
  3.                 {
  4.                     $project: {
  5.                         date: { $dateToString: {date: '$createdAt', format: "%Y-%m-%d"} },
  6.                         expected_paid_amount: "$expected_paid_amount",
  7.                     },
  8.  
  9.                 }, {
  10.                     $group: {
  11.                         _id: "$date",
  12.                         sum: { $sum: '$expected_paid_amount'},
  13.                         count: { $sum: 1 }
  14.                     }    
  15.                 }]
  16.    
  17.             );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement