- Conversione Codice... Errore Service Worker regostration.
- Sistemare quasar.config.ts di piuchebuono! -Le categorie non si vedono piu !!
This commit is contained in:
@@ -69,18 +69,13 @@ module.exports = {
|
||||
|
||||
console.log('ADDING: ', query);
|
||||
|
||||
const { value: existingDoc, upserted } = await table.findOneAndUpdate(
|
||||
query,
|
||||
{ $set: rec },
|
||||
{ upsert: true, new: true }
|
||||
);
|
||||
const newDoc = new table(rec);
|
||||
const insertedDoc = await newDoc.save();
|
||||
if (insertedDoc) {
|
||||
console.log('Inserted document with _id:', insertedDoc._id);
|
||||
|
||||
if (upserted) {
|
||||
// Il documento non esisteva, è stato creato
|
||||
console.log('Inserted document with _id:', existingDoc._id);
|
||||
numrec++;
|
||||
} else {
|
||||
console.log(' ... Non inserito !')
|
||||
console.log(' ... Non inserito !');
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -95,7 +90,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
if (numrec > 0 || numupdated > 0) {
|
||||
console.log(`*** Inserted ${numrec} and updated ${numupdated} records in ${tablename}`);
|
||||
console.log(`------- *** Inseriti ${numrec} e aggiornati ${numupdated} record in ${tablename} ------ `);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user