- 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

@@ -3,7 +3,7 @@ const Schema = mongoose.Schema;
const tools = require('../tools/general');
const { ObjectID } = require('mongodb');
const { ObjectId } = require('mongodb');
mongoose.Promise = global.Promise;
mongoose.level = "F";
@@ -129,7 +129,7 @@ SettingsSchema.statics.setKeyNum = async function (idapp, key, value) {
let myrec = await Settings.findOne({ idapp, key });
if (!myrec) {
myrec = new Settings({ key });
myrec._id = new ObjectID();
myrec._id = new ObjectId();
myrec.idapp = idapp;
myrec.type = tools.FieldType.number;
myrec.value_num = value;
@@ -149,7 +149,7 @@ SettingsSchema.statics.setBool = async function (idapp, key, valbool) {
let myrec = await Settings.findOne({ idapp, key });
if (!myrec) {
myrec = new Settings({ key });
myrec._id = new ObjectID();
myrec._id = new ObjectId();
myrec.idapp = idapp;
myrec.type = tools.FieldType.boolean;
myrec.value_bool = valbool;