Advertisement
obez

mv

Aug 5th, 2016
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 0.54 KB | None | 0 0
  1. db.getCollection('tost').aggregate(
  2. [
  3.     {
  4.         "$project":{
  5.             "_id": "$_id",
  6.             "doc_info": 1,
  7.             "wa_count": {
  8.                     "$size": "$wa"
  9.             },
  10.             "ax_count": {
  11.                 "$sum":{
  12.                     "$map":{
  13.                         "input": "$wa.ax",
  14.                         "as": "sub",
  15.                         "in": {
  16.                             "$size": "$$sub"
  17.                         }
  18.                     }
  19.                 }
  20.             }
  21.         }
  22.     }
  23. ])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement