title: toObjectId for arrrays of String to be used with lookup and aggregate
body: <p>I have 2 models, one is Group and another is Students. Group looks like this</p>
  
  <pre><code>{
      "_id" : ObjectId("5c8d28ef7e0e542854b7b904"),
      "name" : "Homeroom ",
      "year" : 2019,
      "schoolID" : ObjectId("5c1a735fc98da061141475a1"),
      "teachers" : [ 
          {
              "_id" : "5c1a7677c98da061141475aa",
              "firstName" : "Ayam"
          }, 
          {
              "_id" : "5c1a7677c98da061141475a9",
              "firstName" : "Itik"
          }
      ],
      "addedOn" : ISODate("2019-03-16T16:48:47.372Z"),
      "lastModified" : ISODate("2019-03-16T16:48:47.372Z"),
      "__v" : 0,
      "status" : 1,
      "students" : [ 
          "5c1a79f7c98da061141475b7", 
          "5c3bfea37774fb0b55000cb5", 
          "5c1a7c69c98da061141475bb", 
          "5c3bfea37774fb0b55000cb4", 
          "5c1a7d32c98da061141475be", 
          "5c3bfea37774fb0b55000cb7"
      ]
  }
  </code></pre>
  
  <p>Where the field <code>students</code> above stores the _id (in String format) of students inside Students model.</p>
  
  <p>Now I'm trying to do a lookup with aggregate, and I comes up with something like this:</p>
  
  <pre><code>Group.aggregate([
              { $match: { _id: mongoose.mongo.ObjectId(groupID) } },
              { $lookup: { 
                from: "Students", localField: "students", foreignField: "_id", as: "studentList"  
              } },
                { $unwind: "$studentList" },
                { $replaceRoot: { newRoot: "$students" } }
            ], function(err, result){
              if (err){
                console.log("imin err 102: " )
                console.log(err)
              }else{
                console.log("imini 105 result")
                console.log(result);
              }
            });
  </code></pre>
  
  <p>Now I understand that the code above won't yield any result, since <code>students</code> inside Model Group is stored as String, while the _id inside model Student is an ObjectId. Mongodb now have <code>$toObjectId</code> but since my Model holds an array of String, I don't know how to implement <code>$toObjectId</code> correctly.</p>
  
  <p>Here's sample documents for Students</p>
  
  <pre><code>{
      "_id" : ObjectId("5c1a79f7c98da061141475b7"),
      "firstName" : "Ibrahim",
      "kelasID" : ObjectId("5c429f9906f2a805bc6cd494"),
      "lastName" : "Ali",
      "schoolID" : ObjectId("5c1a735fc98da061141475a1"),
      "year" : 2018,
      "__v" : 0,
      "addedOn" : ISODate("2018-12-25T04:27:47.909Z"),
      "checkIn" : false,
      "checkInStatus" : 1,
      "contactNo1" : "012225656",
      "father" : "Ali",
      "fatherID" : "8852245",
      "idType" : 0,
      "lastModified" : ISODate("2018-12-25T04:27:47.909Z"),
      "mother" : "",
      "motherID" : ""
  }
  {
      "_id" : ObjectId("5c3bfea37774fb0b55000cb5"),
      "idType" : 0,
      "checkIn" : false,
      "checkInStatus" : 1,
      "year" : 2019,
      "schoolID" : ObjectId("5c1a735fc98da061141475a1"),
      "kelasID" : ObjectId("5c1a7534c98da061141475a3"),
      "firstName" : "Umar",
      "lastName" : "Bin Al-Khattab",
      "contactNo1" : "601222",
      "status" : 1,
      "addedOn" : ISODate("2019-01-14T03:14:43.597Z"),
      "lastModified" : ISODate("2019-01-14T03:14:43.597Z"),
      "__v" : 0
  }
  {
      "_id" : ObjectId("5c1a7c69c98da061141475bb"),
      "idType" : 0,
      "checkIn" : false,
      "checkInStatus" : 1,
      "year" : 2018,
      "schoolID" : ObjectId("5c1a735fc98da061141475a1"),
      "kelasID" : ObjectId("5c1a7540c98da061141475a5"),
      "firstName" : "Abdul Rahman",
      "lastName" : "Affan",
      "father" : "Affan",
      "fatherID" : "54321",
      "contactNo1" : "602288",
      "status" : 1,
      "addedOn" : ISODate("2018-12-25T04:30:16.130Z"),
      "lastModified" : ISODate("2018-12-25T04:30:16.130Z"),
      "__v" : 0
  }
  </code></pre>