Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. ...
  2. { "_id" : ObjectId("579fc863d246f4640173d0b4"),
  3. "flow" : [ 178488283, NumberLong("4294967295"), NumberLong("4294967295"),
  4. 11, 0, 2, 264,
  5. 1470073539, 1470073539, 48471, 5678, 0, 17, 0, 0, 0, 0, 0 ],
  6. "sequence" : 64754, "sensor" : "192.168.236.1" }
  7. ...
  8.  
  9. db.collector.aggregate(
  10. [{ $group: { _id: 'rx' , bytes : { $sum : 'flow.6' }, count : { $sum :1 }}}] )
  11.  
  12. { "_id" : "rx", "bytes" : 0, "count" : 151291 }
  13.  
  14. > db.collector.aggregate( [ {$unwind: "$flow" },
  15. { $group: { _id: 'rx' , bytes : { $sum : 6 }, count : { $sum :1 }}}] )
  16. { "_id" : "rx", "bytes" : 17328276, "count" : 2888046 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement