# Original, (working) collection.group command. # db.myCollection.group({'key': {'ip1':true}, 'reduce': function(obj,prev) { prev.count += 1; }, 'initial': { 'count':1 } }) # Roughly Equivalent Aggregation query (NOT working) # > db.runCommand({ ... 'aggregate': "myCollection", ... 'pipeline': [ ... {'$group': { ... '_id': '$ip1', ... 'count': {'$sum':1} ... }} ... ] ... }) { "errmsg" : "exception: can't compare values of BSON types 16 and 18", "code" : 16016, "ok" : 0 } >