MongoClient.connect(url, function(err, db) {
assert.equal(null, err);
var track_log= db.collection('track_log');
track_log.insert(self.traffic,function(err,result){ });
});
$uploadModel = new UploadForm();
$model =\app\models\Reportcosttc;
if (Yii::$app->request->isPost) {
$model->load(Yii::$app->request->post());
$uploadModel ->imageFiles = UploadedFile::getInstances($uploadModel, 'imageFiles');
if ( $uploadModel ->upload()) {
$model->Scan_chek = 'uploads/' . $uploadModel ->imageFile->baseName . '.' . $uploadModel ->imageFile->extension;
if($model->save()){
return $this->redirect(['index']);
}
}
}