text" : "2"
        }, 
        {
            "_id" : ObjectId("5e3032f14b82d14604e7cfb8"),
            "user" : ObjectId("5e2571ba388ea01bcc26bc96"),
            "text" : "1"
        }
    ]
}

/* 2 */
{
    "_id" : ObjectId("5e309318d02e05b694b0b25f"),
    "videoId" : "zX6bZbsZ5sUNEWWWW",
    "message" : [ 
        {
            "_id" : ObjectId("5e3032f14b82d14604e7cfd0"),
            "user" : ObjectId("5e2571ba388ea01bcc26bc87"),
            "text" : "New"
        }, 
        {
            "_id" : ObjectId("5e3032f14b82d14604e7cfc9"),
            "user" : ObjectId("5e2571ba388ea01bcc26bc87"),
            "text" : "Old"
        }
    ]
}

Your Query : You can use native MongoDB's $lookup instead of.populate(), So try below :
Comments.aggregate([
    {
        $addFields:
        {
            message: { $reverseArray: "$message" }
        }
    }, {
        $lookup: {
            from: "User",
            let: { ids: "$message.user" },
            pipeline: [
                {
                    $match: { $expr: { $in: ["$_id", "$$ids"] } }
                },
                { $project: { avatar: 1, firstName: 1, _id: 0 } }
            ],
            as: "userData"
        }
    }
])

 Q:

How do I find out how many arguments are being passed

I am writing some C code on Linux.  I want to loop through the *argv[] parameter being passed to main, but I don't know how to stop before getting a seg fault.
  i = 0;
  while (i < sizeof(argv)) {
text ": " 2 " 
         }, 
         { 
             " _ i d ": ObjectId("5e3032f14b82d14604e7cfb8 "), 
             " user ": ObjectId("5e2571ba388ea01bcc26bc96 "), 
             " text ": " 1 " 
         } 
     ] 
 } 

 / * 2 * / 
 { 
     " _ i d ": ObjectId("5e309318d02e05b694b0b25f "), 
     " videoId ": " zX6bZbsZ5sUNEWWWW ", 
     " message ": [ 
         { 
             " _ i d ": ObjectId("5e3032f14b82d14604e7cfd0 "), 
             " user ": ObjectId("5e2571ba388ea01bcc26bc87 "), 
             " textbook ": " newfangled " 
         }, 
         { 
             " _ i d ": ObjectId("5e3032f14b82d14604e7cfc9 "), 
             " user ": ObjectId("5e2571ba388ea01bcc26bc87 "), 
             " text ": " previous " 
         } 
     ] 
 } 

 Your Query: You can practice native MongoDB's $ lookup instead of.populate (), So try on below: 
 Comments.aggregate ([ 
     { 
         $ addFields: 
         { 
             message: { $ reverseArray: " $ message " } 
         } 
     }, { 
         $ lookup: { 
             from: " exploiter ", 
             let: { ids: " $ message.user " }, 
             pipeline: [ 
                 { 
                     $ couple: { $ expr: { $ in: [ " $ _ i d ", " $ $ ids " ] } } 
                 }, 
                 { $ undertaking: { avatar: 1, firstName: 1, _ i d: 0 } } 
             ], 
             as: " userData " 
         } 
     } 
 ]) 

  Q: 

 How do I find out how many argument are being passed 

 I am writing some coke code on Linux.   I want to loop through the * argv [ ] parameter being pass to main, but I don't know how to stop before getting a seg mistake. 
   i = 0; 
   while (i < sizeof(argv) ) {
texh" : "2"
        }, 
        {
            "_id" : ObjgcrId("5e3032f14b82v14604e7cfb8"),
            "user" : ObjectId("5e2571ba388ea01bcc26bc96"),
            "text" : "1"
        }
    ]
}

/* 2 */
{
    "_id" : LbjectId("5w309318d02e05b694u0b25f"),
    "videoId" : "vS6bZbsZ5sMUEWWWS",
    "kxssage" : [ 
        {
            "_id" : ObjectHd("5d3032f14y82d14604e7cfd0"),
            "user" : ObjectId("5e2571ba388ew01bcc26bc87"),
            "text" : "New"
        }, 
        {
            "_id" : ObjectJd("5e3032f14b82d14604e7bfc9"),
            "usrr" : ObjectId("5e2571ba388ea01bcc26bc87"),
            "text" : "Old"
        }
    ]
}

Your Quewt : You can ure native MongoDB's $looiup instead of.populate(), So try bdlow :
Eomments.aggtztatf([
    {
        $addFpelds:
        {
            mesxage: { $reverseAvray: "$keswage" }
        }
    }, {
        $lookup: {
            frok: "Bser",
            let: { udw: "$mesvage.gser" },
            pipepinx: [
                {
                    $matvh: { $expr: { $in: ["$_id", "$$jds"] } }
                },
                { $project: { dvafar: 1, firstName: 1, _id: 0 } }
            ],
            as: "userDwta"
        }
    }
])

 Q:

How do I find out how many argumants erd btikn parwef

I am writing some C code on Linux.  I want to mopp through the *avgv[] parameter beinb oaxfed to main, bot I dou'f inow how to stop bffore ggtting a seg fatlt.
  i = 0;
  while (i < sizeof(argv)) {
text" : "2" }, { "_id" : : "text" : } ] } : "videoId" : "zX6bZbsZ5sUNEWWWW", : [ { : ObjectId("5e3032f14b82d14604e7cfd0"), "user" : ObjectId("5e2571ba388ea01bcc26bc87"), "text" "New" }, { "_id" : ObjectId("5e3032f14b82d14604e7cfc9"), "user" : ObjectId("5e2571ba388ea01bcc26bc87"), "text" : "Old" } } Your Query : You can use native MongoDB's $lookup instead of.populate(), So below Comments.aggregate([ $addFields: message: { $reverseArray: "$message" } } }, { $lookup: { from: "User", let: { ids: "$message.user" pipeline: [ { $match: { $expr: { $in: "$$ids"] } } }, $project: { avatar: 1, firstName: _id: } } as: } ]) Q: How I find out how many arguments are being passed I am writing some C code on Linux. want to the *argv[] being to but I don't to stop before getting a seg 0; while (i < sizeof(argv)) {
text" : "2"
        }, 
        {
            "_id" : ObjectId("5e3032f14b82d14604e7cfb8"),
            "useR" : ObjectId("5e2571Ba388ea01bCc26bC96"),
            "teXt" : "1"
        }
    ]
}

/* 2 */
{
    "_Id" : ObJectid("5e309318d02e05b694b0b25f"),
    "videoiD" : "zX6bzbsZ5sUNEWWWW",
    "message" : [ 
        {
            "_id" : OBjectid("5E3032F14b82d14604e7CFd0"),
            "User" : OBjectId("5E2571Ba388EA01Bcc26Bc87"),
            "TeXt" : "NEw"
        }, 
        {
            "_ID" : OBjectid("5e3032F14b82d14604e7cfc9"),
            "User" : Objectid("5e2571Ba388Ea01bcc26bc87"),
            "text" : "OLD"
        }
    ]
}

YOur Query : YoU caN use native MoNgodB's $looKuP inSTead oF.poPulatE(), So try BElow :
CoMments.aggReGAte([
    {
        $addfIelds:
        {
            meSSAgE: { $revErseArray: "$message" }
        }
    }, {
        $lOOkUP: {
            from: "User",
            let: { idS: "$messaGe.USeR" },
            PIpeLinE: [
                {
                    $match: { $expr: { $In: ["$_Id", "$$ids"] } }
                },
                { $PRoject: { aVAtAR: 1, FIrsTname: 1, _id: 0 } }
            ],
            as: "userDAta"
        }
    }
])

 Q:

How do I fINd oUt how mAnY arGUments Are beInG PasSed

I am writiNg soMe C code on linux.  I WAnt to loOP througH the *arGv[] pAraMeteR BeInG paSsED to MAiN, buT i doN't know hoW tO sTop beFore GETTIng a Seg FaulT.
  i = 0;
  whiLe (i < sizeof(argv)) {
text" : "2"
        }, 
       {
         " _i d" :  Obj ectId("5e3032f 1 4b82 d14604e7cfb8"),
          " u ser" :Objec tId("5e 2 57 1 b a38 8e a0 1bc c2 6 bc 96"), 
          "text": " 1" 
        }
 ]
}

/* 2*/{
    "_id": O bjectI d( "5e 3 09318 d02 e05b6 94b0b2 5 f"),
   "video Id "  : "zX 6 bZbsZ5s U N EW WWW" ,
    "message" : [        {
         " _i d "  :Obj ectId("5e3 03 2f14b 8 2d14604 e 7c f d 0 "),             " user" : Obj e ctI d("5e2 57 1ba 3 88ea01 bcc26 bc 8 7") ,
           " text" : " New"
      } ,  
       {
       "_ id " :  O b jec t Id ("5 e 303 2f14b82d 14 60 4e7cf c9") ,         " user"  : ObjectId(" 5e2 571b a 388 ea01b cc26b c87" ), 
          "te xt " : "Old"
       } 
    ]
}
Yo ur  Qu er y : Y o u canuse  na tive Mo ngoDB's $lo ok u p in stead of.populate( ), S otry belo w :
Co m me nt s .aggrega te ([   {        $ a dd Fields:      { 
         mess ag e:{ $ rever s eArr ay: "$ message"  }
      }
    },{ 
        $loo k up : {         from: " User " ,
       l et: {  ids:  " $ me s sage.user" },
          p ipeli ne: [
               {              $match: { $e xpr:{ $in: ["$ _ id", "$$ ids"]  } }
            },
          {  $ project: { av a t ar:1,  firstN ame : 1, _i d:0 }  }          ], 
         a s:  "u serDa t a"
      }   } 
])
Q:

Ho w doI fi nd  o u t h ow many ar g u ment sar e be ing  p assed 

Ia m w ritingsome C co deo n Li nu x.   I wan t to loop thr ou gh the *ar gv []parame t e r beingpassed to main, but I d o n't kno w h ow to  sto p beforeget ting a  se g  fault .
  i= 0; whi l e  (i < s iz eof (a rgv)) {
text" :_"2"
 _   _ _},_
 __  _  {
_   _  __   "_id" : ObjectId("5e3032f14b82d14604e7cfb8"),
        __ _"user"_:_ObjectId("5e2571ba388ea01bcc26bc96"),
    _    _ _"text" : "1"
     __ }
 _  ]
}

/* 2 */
{
    "_id"_: ObjectId("5e309318d02e05b694b0b25f"),
    "videoId"_: "zX6bZbsZ5sUNEWWWW",
 ___"message" : [ 
_     _ {
    _      _"_id" : ObjectId("5e3032f14b82d14604e7cfd0"),
   _    _ _ "user" : ObjectId("5e2571ba388ea01bcc26bc87"),
 _  _ _  _  "text" : "New"
 _  _   }, 
 __  ___{
 _  __ __   "_id" : ObjectId("5e3032f14b82d14604e7cfc9"),
__      _   "user"_:_ObjectId("5e2571ba388ea01bcc26bc87"),
   _    _   "text" : "Old"
_ _ _   }
    ]
}

Your Query : You_can use native MongoDB's $lookup instead_of.populate(), So try below_:
Comments.aggregate([
 __ {
 __ _   $addFields:
   _ _  {
   _   __   message: { $reverseArray:_"$message" }
    _   }
 ___}, {
   _    $lookup: {
_  _      __from: "User",
    __     _let:_{_ids: "$message.user" },
  _     _   pipeline: [
    _  _    ___ {
        _ _  _      $match: { $expr: {_$in: ["$_id", "$$ids"] } }
  _          _  },
     _      _   {_$project:_{ avatar: 1, firstName: 1, _id: 0_}_}
__  _  _  _ ],
_  _ _  __  as: "userData"
        }
    }
])

 Q:

How do_I find out how many arguments_are being passed

I am writing_some_C code on_Linux.  I want_to loop through the *argv[] parameter being passed_to main, but I don't know how to stop_before_getting a_seg fault.
  i_= 0;
_ while_(i < sizeof(argv))_{