MongoServerError: PlanExecutor error during aggregation :: caused by :: Out of memory

I solved it using the following

db.user_103_tmp.aggregate([
  {
    $group: {
      _id: "$userid",
      v: { $push: "$$ROOT" }
    }
  }
  {
        $out: "user_103_group"
    }
])