Open in app

Sign In

Write

Sign In

Yadollah khaje hosseini
Yadollah khaje hosseini

9 Followers

Home

About

Dec 19, 2022

Update And find All Nested Quey In MongoDB

db.medicalRecords.updateMany({$and:[{legalVisits: { $exists: true, $ne: [] }},{“legalVisits.legalVisitType”:”donated_egg”}]},{$set:{ “legalVisits.$[].legalVisitType” : “Ali”}}) db.medicalRecords.findOne({$and:[{forensicMedicineVisits: { $exists: true, $ne: [] }},{“forensicMedicineVisits.forensicMedicineVisitType”:”donated_egg”}]})

Mongodb

1 min read

Mongodb

1 min read


Nov 7, 2022

Downloading data in excel format with PHP And Unicode

public function _exportToCSV($status){ $columnHeader = ""; $setData = ''; $findAll = ImportUsers::model()->findAll("status = $status"); if(!empty($findAll)){ foreach($findAll as $objData){ $rowData = ''; $value = '"' . $objData->title1 . '"' . "\t"; $value .= '"' . $objData->title2 . '"' . "\t"; $value .= '"' . $objData->title3 . '"' . "\t"; $rowData .= $value; $setData .= trim($rowData) . "\n"; } } $fileName = 'output.csv'; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename = $fileName"); header('Content-Transfer-Encoding: binary'); header("Pragma: no-cache"); header("Expires: 0"); echo chr(255).chr(254).iconv("UTF-8", "UTF-16LE//IGNORE", $setData . "\n"); exit(); }

Csv

1 min read

Csv

1 min read


Sep 13, 2022

Order By Persian Title In MySQL

1: Change Collection Field To “utf8_persian_ci” 2: In Query SELECT * FROM campaigns ORDER BY title COLLATE utf8_persian_ci 3: In Yii Framework $academics = Academic::find() ->where([ ‘organization_id’ => $_POST[‘organization’], ‘academic_year_id’ => $_POST[‘academicYear’], ‘base_id’ => $_POST[‘base’], ‘field_id’ => $_POST[‘field’] ]) ->andWhere([‘IN’,’status’,$arrayStatus]) ->joinWith(‘profiles p’)

MySQL

1 min read

Order By Persian Title In MySQL
Order By Persian Title In MySQL
MySQL

1 min read


Aug 21, 2022

FindOne For Nested Document In NestJs

async findOne(findOneTurnOfTimePlanDetailDto: FindOneTurnOfTimePlanDetailDto ){ let filter = { _id: findOneTurnOfTimePlanDetailDto.planDetailId…

Nestjs

1 min read

Nestjs

1 min read


Aug 13, 2022

Search like number field in MongoDb by NestJs

let aggregateTotal = []; let aggregateMatch = {}; if (searchServiceDto.hasOwnProperty('code')) { Object.assign(aggregateMatch, { codeStr: new RegExp(searchServiceDto.code.toString()), }); } aggregateTotal.push( { $addFields : { codeStr: { $toString: '$code' } } } ) aggregateTotal.push({ $match: aggregateMatch, }); aggregateTotal.push( { $project : { codeStr: 0 } } )

Mongodb

1 min read

Mongodb

1 min read


Jul 11, 2022

Downloading data in excel format with Nest.js

1: use :: https://wajihaabid.medium.com/downloading-data-in-excel-format-with-nest-js-4a0a859bf430 excel.controller.ts import {Controller, Get, Header, Res} from '@nestjs/common'; import { ExcelService } from './excel.service'; import {Response} from "express"; @Controller('excel') export class ExcelController { constructor(private readonly excelService: ExcelService) {} @Get('/download') @Header('Content-Type', 'text/xlsx') async downloadReport(@Res() res: Response) { let data = […

Nestjs

1 min read

Nestjs

1 min read


Jun 14, 2022

Deploy simple nestJs application on Server

1: install Node https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-20-04 curl -sL https://deb.nodesource.com/setup_16.x -o nodesource_setup.sh nano nodesource_setup.sh bash nodesource_setup.sh apt install nodejs node -v npm -v apt install build-essential npm audit 2:install mongo https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-20-04

Nestjs

1 min read

Nestjs

1 min read


Jun 11, 2022

Solve the problem How to fix Error: cannot find module “webpack”

1: Error internal/modules/cjs/loader.js:905 throw err; ^ Error: Cannot find module ‘webpack’ Require stack: 2: https://www.educative.io/edpresso/how-to-fix-error-cannot-find-module-webpack npm install webpack npm link webpack Enjoy

Nestjs

1 min read

Nestjs

1 min read


May 22, 2022

Create Batch File For Dump From MongoDB And Set Scheduler

1: name:: batch_for_dump.bat 2: @ECHO OFF for /f “skip=1” %%i in (‘wmic os get localdatetime’) do if not defined fulldate set fulldate=%%i set year=%fulldate:~0,4% set month=%fulldate:~4,2% set day=%fulldate:~6,2% set foldername=%year%_%month%_%day% md C:\data\db\%foldername% mongodump — host=*.*.*.* — port=*** — username root — password ****— db mom_*** — authenticationDatabase admin -o C:\data\db\%foldername% PAUSE

Dump Database

1 min read

Create Batch File For Dump From MongoDB And Set Scheduler
Create Batch File For Dump From MongoDB And Set Scheduler
Dump Database

1 min read


May 11, 2022

Best documentation in NestJs

Documentation | NestJS - A progressive Node.js framework Compodoc is a documentation tool for Angular applications. Since Nest and Angular share similar project and code…docs.nestjs.com npm i -D @compodoc/compodoc npx @compodoc/compodoc -p tsconfig.json -s

Nestjs

1 min read

Best documentation in NestJs
Best documentation in NestJs
Nestjs

1 min read

Yadollah khaje hosseini

Yadollah khaje hosseini

9 Followers

I am a Back-End Developer

Following
  • Jeannot Muller

    Jeannot Muller

  • Royi Benita, Senior Full Stack Developer At Armis

    Royi Benita, Senior Full Stack Developer At Armis

  • Vladimir Agaev

    Vladimir Agaev

  • Kevin Vogel

    Kevin Vogel

  • Eason Chai

    Eason Chai

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech