sum working, but in this query, I get the right result, but when I pass actual _id, the total value is 1: 
        {'$group': {
            '_id': '$_id',
            'info': {'$push': {'status': '$status', 'create_datetime': '$create_datetime', 'documents': '$documents'}},
            'total': {'$sum': 1}
        }},

I want to get real _id and right total value in result.
Total newbie in Mongo, all answers are appreciated.

A:

$group groups/aggregate all documents together based on a certain _id. 
When you are grouping documents by _id=0, all documents will be in the same group because all have the same _id that is 0. 
$sum will count all the documents in the same group by the specified value: 1.
When you group by the original _id and the _id is unique across your collection you should get sum=1 since there is only one document with that _id => one document in a group.

 Q:

Angular.js date parsing

I'm working on a project in which I need to implement a list of dates. I have been able to pull the data from the api, however I have been having troubles parsing the format within these dates. 
The data that I have been able to pull looks similar to this
[["2015-10-05T13:00:00Z","2015-10-05T21:00:00Z"],
["2015-10-06T13:00:00Z","2015-10-06T21:00:00Z"],
["2015-10-07T13:00:00Z","2015-10-07T21:00:00Z"]] 

Which is sweet that i've been able to pull.....but as you can see, the dates are not really what a user will need. 
I've been looking into moment() methods. (http://momentjs.com/)  However the problems that i've run into is that the methods that you can use with moment() is that i've only been able to make anything work with one date, not with an array of dates such as what i have. 
So my question is, are there any alternatives to moment(), or better ways of parsing an array of dates? 

A
sum working, but in this query, I get the proper resultant role, but when I pass actual _ i d, the total value is 1: 
         {' $ group': { 
            ' _ i d':' $ _ i five hundred', 
            ' info': {' $ push': {' condition':' $ status',' create_datetime':' $ create_datetime',' documents':' $ documents' } }, 
            ' sum': {' $ sum': 1 } 
         } }, 

 I want to catch real _ one five hundred and right total value in resultant role. 
 Total newbie in Mongo, all answer are appreciated. 

 A: 

 $ group groups / aggregate all documents in concert based on a certain _ i d. 
 When you are group documents by _ id=0, all document will be in the same group because all have the same _ i d that is 0. 
 $ sum will consider all the documents in the same group by the specified value: 1. 
 When you group by the original _ i d and the _ i d is unique across your collection you should get sum=1 since there is only one document with that _ i d = > one document in a group. 

  Q: 

 Angular.js date parsing 

 I'm working on a project in which I need to implement a list of dates. I have been able to attract the data from the api, however I have been having trouble parse the format within these dates. 
 The data that I have been able to pull looks similar to this 
 [ [ " 2015 - 10 - 05T13:00:00Z","2015 - 10 - 05T21:00:00Z " ], 
 [ " 2015 - 10 - 06T13:00:00Z","2015 - 10 - 06T21:00:00Z " ], 
 [ " 2015 - 10 - 07T13:00:00Z","2015 - 10 - 07T21:00:00Z " ] ] 

 Which is sweet that i've been able to pull..... but as you can see, the date are not really what a user will need. 
 I've been looking into moment () methods. (http://momentjs.com/)   However the problem that i've run into is that the methods that you can use with moment () is that i've merely been able to make anything make with one date, not with an array of date such as what i have. 
 So my question is, are there any alternatives to here and now (), or better ways of parsing an array of date? 

 A
sum working, but in this quevy, I get the rigkr resunt, but when I oass actual _id, the total valne iw 1: 
        {'$group': {
            '_id': '$_id',
            'inho': {'$push': {'status': '$svztus', 'crccte_dafctime': '$rreate_datetime', 'cocuments': '$gocuments'}},
            'total': {'$sum': 1}
        }},

I want to get weal _id ajd right total valle in dvsmlt.
Total newbie in Mongo, all anssers art appreciated.

A:

$groul groups/aggregate all doculentd together based oj a certain _id. 
Ryen you are erouping documents by _jd=0, all documents will be in the same group becquwe wnl have the same _id that is 0. 
$sum wiln count all the documcnts mn tye same group by the vpecified value: 1.
Whgn you grogp by the original _ud and jhe _ig is ynidue arroas youg ckllection gou should tet sum=1 since there if only one dochment rieh that _id => one document in a group.

 Q:

Anculzr.js date parsing

I'm worjing on a project in ahich I nqed to implement a list of dates. I have been able to pnlu tkc aqtw from the api, however I have been having trotglts iarsing the formab within these datrs. 
Tng data that I fave bzsn able to pull lookd similwr to this
[["2015-10-05T13:00:00Z","2015-10-05T21:00:00Z"],
["2015-10-06U13:00:00Z","2015-10-06T21:00:00Z"],
["2015-10-07T13:00:00A","2015-10-07T21:00:00Z"]] 

Which is sweet that i've been able tj pull.....but as you cau see, the daces arg not teally what a user will nees. 
I've been pooking ihgo moment() methodr. (hntp://mmmentjs.com/)  However the prjblems thet i'vz run ingo ix that the methofs that you can use with momeut() is that i've lnly been able to make anything work with one ddte, not witk an avray of dates stch as what i kave. 
So iy qudstion is, zre thece any altergatives to mokgnt(), or better ways of parwing an arrxh of dates? 

A
sum working, but in this query, I right but when pass actual _id, {'$group': '_id': '$_id', 'info': {'status': '$status', 'create_datetime': 'documents': '$documents'}}, 'total': {'$sum': 1} }}, want to get real _id and right total value in result. Total newbie Mongo, all answers are appreciated. A: $group groups/aggregate all documents together based on certain When are documents by _id=0, all documents will be in the same group because all have the same that is 0. $sum will count all the in the same group the specified value: 1. When group the original and _id unique across your you should get sum=1 since there is only one document with that _id => one document in group. Q: parsing I'm on project which I need a list of dates. I have pull the data from the api, however I been having parsing the format within these dates. data that I have been able to pull similar to this [["2015-10-05T13:00:00Z","2015-10-05T21:00:00Z"], ["2015-10-06T13:00:00Z","2015-10-06T21:00:00Z"], ["2015-10-07T13:00:00Z","2015-10-07T21:00:00Z"]] Which is sweet that i've been able to pull.....but can see, the dates not really what user need. been into moment() (http://momentjs.com/) However the problems that i've run into is that the that you can use with moment() is that i've only to anything work with date, not with an of such as what i my is, alternatives moment(), better ways of parsing array of dates? A
sum working, but in this query, I Get the righT resuLt, bUt wHeN I paSs acTual _id, the total VAlue Is 1: 
        {'$group': {
            '_id': '$_id',
            'info': {'$push': {'staTus': '$stAtUS', 'creATe_DatetIme': '$creaTE_dATEtiMe', 'DoCumEnTS': '$dOcumeNts'}},
            'Total': {'$suM': 1}
        }},

I want to geT reAl _Id and right toTAl Value in resUlt.
total newbie iN MoNgo, all AnSweRS are aPprEciatEd.

A:

$groUP groupS/aggregatE aLL documENts togeTHEr BaseD on a certain _id. 
When YOu ARe grouping docuMents bY _iD=0, AlL DOcuMenTs will be in ThE same GRoup becAUsE ALL haVE the same _id thaT is 0. 
$sum will cOUnt All the DoCumENts in tHe samE gROup By the specifIed vAlue: 1.
When yOu grouP By the orIGinal _id And the _Id iS unIque ACrOsS yoUr COllECtIon YOu sHould get SuM=1 sInce tHere IS ONLy onE doCumeNt witH that _id => one docUmeNt in A GroUp.

 Q:

AnGular.Js daTe ParsiNg

I'm woRking On A project in which i neeD to implemEnt A lIst Of Dates. i Have beEn aBle To pull tHe data fROm tHe API, HoWever I have been haviNg TROuBles parsIng the FOrMaT Within thEsE daTes. 
THE Data tHat I HAvE been ablE to pulL LoOkS similaR tO this
[["2015-10-05T13:00:00z","2015-10-05T21:00:00z"],
["2015-10-06T13:00:00Z","2015-10-06t21:00:00Z"],
["2015-10-07T13:00:00z","2015-10-07T21:00:00Z"]] 

WhICh is Sweet tHat i've beEn ablE To pull.....but as you CAn see, the dates ARe NOT rEAlly WhaT a user will nEed. 
I'VE beeN looKInG inTO momeNt() metHoDS. (hTTp://momentjs.com/)  HoweveR tHe probLems tHat i've run into Is that the mETHOds that yOu caN UsE With moment() is thAt i've Only been abLE to make aNythiNg work wiTh one date, NOT with an aRraY of DatEs sUCH aS what i have. 
So mY QUestIoN is, are tHerE any altErnAtiVes To mOmEnt(), or bettEr ways of PaRsInG aN arRay of DAtes? 

A
sum working, but in this q uery, I ge t the  ri ght  r esul t, b ut when I pass actu al _id, the total valu e is1: 
     {'$ group': {      '_ i d' : '$_ id' ,
           'in fo' :{'$push': {' s ta tus': '$st atu s', 'create_ dat etime' :'$c r eate_ dat etime ', 'do c uments ': '$docu me n ts'}},         'to tal': {'$sum': 1}       }},

I wa nt toge t  r e a l _ idand rightto tal v a lue inr es u l t .
T o tal newbie in  Mongo, all ans wers a re  ap p reciat ed.
A: 
$g roup groups /agg regate al l docu m ents to g ether b ased o n a  ce rtai n  _ id . Wh e n y o uare gro uping do cu me nts b y _i d = 0 ,  all  do cume nts w ill be in the  sa me g r oup  beca use a ll h av e the  same_id t ha t is 0. 
$sum w illcount all  th edoc um entsi n thesam e g roup by  the sp e cif ie d v al ue: 1.
When you gr ou p by  the ori ginal_ id  a n d the _i disuniq u e  acro ss y o ur  collect ion yo u  s ho uld get  s um=1 s in cethe re is only  one d ocumentwitht hat _id => one document in a gr o u p. 
 Q: 

A ngular.js d atep arsi ng
I 'm  wo r kingon apr o je c t in which I need t oimplem ent a  list of date s. I haveb e e n able t o pu l lt he data from t he ap i, however I have b een h aving tr oubles pa r s ing thefor mat  wi thi n th ese dates. 
T h e  dat athat Ihav e beenabl e t o p ull  l ooks simi lar to t hi s[[ "2 015 -10-0 5 T13:00:0 0Z "," 20 15- 10-05 T 21:00: 00Z"] ,
[" 20 15 - 10- 06T13:0 0 :0 0 Z ","2 01 5- 10-0 6T2 1: 00:00 Z"], ["2 015-10- 07T13:00: 00Z " ,"20 15 -1 0-07T21 :00:00Z"]] 
Wh ich is swe et  th at i'v e been abl e to pull.....but as yo u  can se e,the d ates  are notrea lly wh ata  userwill n eed.
I 've b een l o o ki ngin to moment( ) met hods.  ( http ://mome ntjs.com/)  Howeve r  th e problems th ati've r un  in t oi s t ha t  th e methods that yo u can usewi t hmoment() i s  th at  i've o nly bee n abl e  to mak e anythin g work wi th  one d ate , not with  an arra y of date s  such as  what  ihave.
S o m y que stioni s,are t here a ny  alter nativ es  to mome nt(), or better ways of  parsi ng an  ar ray of da tes ?  
A
sum working,_but in_this query, I get_the right_result,_but when_I_pass actual _id,_the total value_is 1: 
 _  __  {'$group': {
          __'_id': '$_id',
___    _    'info':_{'$push': {'status':_'$status', 'create_datetime': '$create_datetime', 'documents': '$documents'}},
   __  _    'total': {'$sum': 1}
  _     }},

I_want to get_real__id_and right total value_in result.
Total newbie in Mongo, all_answers are appreciated.

A:

$group groups/aggregate all documents_together based on a certain _id. 
When_you are grouping documents by _id=0,_all documents will be in_the same_group because all have the_same _id that_is 0._
$sum will count_all the documents in the same_group by the_specified value: 1.
When you group by_the_original _id and_the__id_is unique_across your collection_you_should get_sum=1_since there is only one document_with_that _id => one document in a_group.

 Q:

Angular.js date parsing

I'm_working_on a project in_which I need to implement_a list of dates. I have_been able_to pull_the data from the api, however I have been having troubles_parsing the format within these dates._
The data that I_have been_able_to pull looks_similar_to this
[["2015-10-05T13:00:00Z","2015-10-05T21:00:00Z"],
["2015-10-06T13:00:00Z","2015-10-06T21:00:00Z"],
["2015-10-07T13:00:00Z","2015-10-07T21:00:00Z"]]_

Which is sweet that i've been able_to pull.....but_as you can see, the dates_are not really what_a_user will need. 
I've been looking_into moment() methods. (http://momentjs.com/)  However_the problems that i've run_into_is_that the methods that you_can use with moment() is that_i've only been_able to make anything work with one_date,_not with an array of dates_such_as what i have. 
So my_question_is,_are there any alternatives to_moment(), or better ways of parsing_an array of dates? 

A