Relatively Simple Scenario:
I have this Voucher object which has a user property (of type ObjectId). I want to get the sum of
Voucher
user
ObjectId
use toString() method.
{ $match : { user : user_id.toString() , expires : { $gt : new Date() } } }