- aggiornata la grafica della Home di RISO
- Profilo Completition - Email Verificata - Invita un Amico (invio di email)
This commit is contained in:
52
src/models/cfgserver.js
Executable file
52
src/models/cfgserver.js
Executable file
@@ -0,0 +1,52 @@
|
||||
const mongoose = require('mongoose').set('debug', false)
|
||||
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
|
||||
mongoose.plugin(schema => {
|
||||
schema.options.usePushEach = true
|
||||
});
|
||||
|
||||
const CfgServerSchema = new Schema({
|
||||
chiave: {
|
||||
type: String,
|
||||
trim: true,
|
||||
minlength: 1,
|
||||
},
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
userId: {
|
||||
type: String,
|
||||
},
|
||||
valore: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
CfgServerSchema.statics.DuplicateAllRecords = async function (idapporig, idappdest) {
|
||||
|
||||
return await 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);
|
||||
|
||||
CfgServer.createIndexes()
|
||||
.then(() => { })
|
||||
.catch((err) => { throw err; });
|
||||
|
||||
|
||||
module.exports = {CfgServer};
|
||||
|
||||
Reference in New Issue
Block a user