Corretto Duplicazione Sito (es: da 1 a 14)
This commit is contained in:
@@ -4,6 +4,7 @@ const Schema = mongoose.Schema;
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
const tools = require('../tools/general');
|
||||
const { ObjectID } = require('mongodb');
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
@@ -11,7 +12,7 @@ mongoose.plugin(schema => {
|
||||
schema.options.usePushEach = true
|
||||
});
|
||||
|
||||
const cfgserverSchema = new Schema({
|
||||
const CfgServerSchema = new Schema({
|
||||
chiave: {
|
||||
type: String,
|
||||
trim: true,
|
||||
@@ -28,4 +29,19 @@ const cfgserverSchema = new Schema({
|
||||
},
|
||||
});
|
||||
|
||||
mongoose.model('cfgserver', cfgserverSchema);
|
||||
CfgServerSchema.statics.DuplicateAllRecords = async function (idapporig, idappdest) {
|
||||
|
||||
return tools.DuplicateAllRecords(this, idapporig, idappdest);
|
||||
|
||||
};
|
||||
|
||||
CfgServerSchema.statics.findAllIdApp = async function(idapp) {
|
||||
const myfind = { idapp };
|
||||
|
||||
return await CfgServer.find(myfind).lean();
|
||||
};
|
||||
|
||||
const CfgServer = mongoose.model('CfgServer', CfgServerSchema);
|
||||
|
||||
module.exports = {CfgServer};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user