标签:deb script return java collect ota group bit sort
Sum
按照条件求和
db.aa.aggregate([ { $group: { _id: null, total: { $sum: "$value" } } }, //$value 指的是按照那一列来sum。比如 value是mongo的一列。那么此处应该是 $value { $sort: { total: -1 } } ])
Where条件
db.myCollection.find( { $where: "this.credits == this.debits" } ); db.myCollection.find( { $where: "obj.credits == obj.debits" } ); db.myCollection.find( { $where: function() { return (this.credits == this.debits) } } ); db.myCollection.find( { $where: function() { return obj.credits == obj.debits; } } );
标签:deb script return java collect ota group bit sort
原文地址:http://www.cnblogs.com/haoliansheng/p/6234009.html