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’)

  • >orderBy(new \yii\db\Expression(‘p.lname COLLATE utf8_persian_ci’));

Enjoy It.

--

--

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
}
}
)
let data = await this.serviceSoftModel.aggregate(aggregateTotal);

type code in MongoDb is number

--

--

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

3:

Result:

--

--

console.log('starting classify...')
//let classification = await client.classifyText({ document });

/**
* handel classify error start
*/
let classification : any;
const operation = new Promise<any>((resolve, reject) => {
client.classifyText({ document }).then(
(onResolved) => {
resolve(onResolved);
},
(onRejected) => {
reject(onRejected);
})
});
try{
classification = await operation;
}catch (e) {
console.log('classification error:::', e)
}
/**
* handel classify error end
*/

console.log('classification done')
console.log(classification)
if(!!classification) /** handel null value **/
processResult = Object.assign(storeMailObject, classification[0])
else
processResult = Object.assign(storeMailObject, { categories: [] })

--

--