草庐IT

outstandingAmount

全部标签

php - 如何获得MongoDB中两个字段的差异之和?

我已经有了一个解决方案,但我正在寻找一个可以在MongoServer上完成所有工作的解决方案(因为我认为它会更快并且内存消耗更少)我有一个类方法:functiongetTotalOutstandingAmount(){$outstandingAmount=0;$subs=$this->mongo->selectCollection('SmsSubscriptions');$activeSubsctiptions=$subs->find(array('Status'=>1,'$where'=>"this.SubscriptionPayments现在有没有一种方法可以使用MongoDB的a