- Cataloghi

- Import ed Export Pagine
- ObjectID sostituita con ObjectId
This commit is contained in:
Surya Paolo
2024-12-17 17:55:47 +01:00
parent 14b3e18986
commit 300bab2125
91 changed files with 404 additions and 272 deletions

View File

@@ -16,7 +16,7 @@ const axios = require('axios');
const CryptoJS = require('crypto-js');
const Url = require('url-parse');
const { ObjectID, ObjectId } = require('mongodb');
const { ObjectId } = require('mongodb');
const shared_consts = require('./shared_nodejs');
@@ -845,7 +845,7 @@ module.exports = {
CloneRecordToNew(src) {
const myrec = Object.assign({}, src);
delete myrec._doc['_id'];
myrec._id = new ObjectID();
myrec._id = new ObjectId();
return myrec._doc;
},
@@ -2646,6 +2646,8 @@ module.exports = {
filtriadded.push({ 'profile.teleg_id_old': { $gt: 1 } });
if (params.filterand.includes(shared_consts.FILTER_USER_PROVINCE))
filtriadded.push({ 'profile.resid_province': { $exists: true } });
if (params.filterand.includes(shared_consts.FILTER_USER_SENZA_PROVINCE))
filtriadded.push({ 'profile.resid_province': { $exists: false } });
if (params.filterand.includes(shared_consts.FILTER_ATTIVI))
filtriadded.push({
$or: [
@@ -2715,10 +2717,10 @@ module.exports = {
let condition = {};
for (const myfilter of params.filtercustom) {
if (myfilter['userId']) {
myfilter['userId'] = ObjectID(myfilter['userId']);
myfilter['userId'] = ObjectId(myfilter['userId']);
}
if (myfilter['_idOBJ']) {
filtriadded.push({ _id: ObjectID(myfilter['_idOBJ']) });
filtriadded.push({ _id: ObjectId(myfilter['_idOBJ']) });
} else if (myfilter['dateTimeStart']) {
const gte = myfilter['dateTimeStart'].$gte;
const lte = myfilter['dateTimeStart'].$lte;
@@ -3398,7 +3400,7 @@ module.exports = {
for (let ind = 0; ind < arrrec.length; ind++) {
let newrec = new mythistable(arrrec[ind]);
newrec._id = new ObjectID();
newrec._id = new ObjectId();
newrec.idapp = idappdest;
try {