- aggiunto il Comune di Residenza alla REgistrazione e al Tutorial
This commit is contained in:
@@ -37,6 +37,21 @@ const Macro = require('../modules/Macro');
|
||||
class CronMod {
|
||||
constructor() {}
|
||||
|
||||
async RimuoviInteri(mytable) {
|
||||
try {
|
||||
console.log('INIZIO - RimuoviInteri ', mytable.modelName);
|
||||
|
||||
const arr = await mytable.find({ _id: { $lte: 10000 } });
|
||||
console.log(' search interi...', arr.length);
|
||||
|
||||
const ris = await mytable.deleteMany({ _id: { $lte: 10000 } });
|
||||
|
||||
console.log('FINE - RimuoviInteri ', mytable.modelName, ris);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
async eseguiDbOp(idapp, mydata, req, res) {
|
||||
let ris = await User.DbOp(idapp, mydata);
|
||||
|
||||
@@ -67,11 +82,11 @@ class CronMod {
|
||||
} else if (mydata.dbop === 'EsportaInfoProductExtra') {
|
||||
const macro = new Macro(idapp, {});
|
||||
mystr = await macro.EsportaInfoProductExtra();
|
||||
ris = { mystr };
|
||||
ris = { mystr };
|
||||
} else if (mydata.dbop === 'ImportaInfoProductExtra') {
|
||||
const macro = new Macro(idapp, {});
|
||||
mystr = await macro.ImportaInfoProductExtra();
|
||||
ris = { mystr };
|
||||
ris = { mystr };
|
||||
} else if (mydata.dbop === 'ScraperEstraiDatiAmazon-NoUpdate') {
|
||||
mystr = await AmazonBookScraper.ScraperMultipleDataAmazon(idapp, {
|
||||
update: false,
|
||||
@@ -425,6 +440,20 @@ class CronMod {
|
||||
await ConvertiDaIntAStr(MyGroup);
|
||||
|
||||
console.log('FINE - Conversioni');
|
||||
} else if (mydata.dbop === 'RemoveDatiInutiliMySkill') {
|
||||
const { MySkill } = require('../models/myskill');
|
||||
|
||||
try {
|
||||
const docs = await MySkill.find({}).lean();
|
||||
|
||||
for (const doc of docs) {
|
||||
await MySkill.replaceOne({ _id: doc._id }, doc);
|
||||
}
|
||||
ris = true;
|
||||
console.log('RIS', ris);
|
||||
} catch (e) {
|
||||
console.error('err', e);
|
||||
}
|
||||
} else if (mydata.dbop === 'Removeinteger') {
|
||||
const { MySkill } = require('../models/myskill');
|
||||
const { MyBacheca } = require('../models/mybacheca');
|
||||
@@ -434,11 +463,11 @@ class CronMod {
|
||||
|
||||
console.log('INIZIO - Rimozione');
|
||||
|
||||
await RimuoviInteri(MySkill);
|
||||
await RimuoviInteri(MyBacheca);
|
||||
await RimuoviInteri(MyHosp);
|
||||
await RimuoviInteri(MyGood);
|
||||
await RimuoviInteri(MyGroup);
|
||||
await this.RimuoviInteri(MySkill);
|
||||
await this.RimuoviInteri(MyBacheca);
|
||||
await this.RimuoviInteri(MyHosp);
|
||||
await this.RimuoviInteri(MyGood);
|
||||
await this.RimuoviInteri(MyGroup);
|
||||
|
||||
console.log('FINE - Rimozione');
|
||||
} else if (mydata.dbop === 'createAllCircuits') {
|
||||
|
||||
Reference in New Issue
Block a user