aggiornamento Indici
This commit is contained in:
@@ -741,4 +741,8 @@ AccountSchema.statics.updateSaldoAndTransato_AllAccounts = async function (idapp
|
||||
|
||||
const Account = mongoose.model('Account', AccountSchema);
|
||||
|
||||
Account.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Account };
|
||||
|
||||
@@ -64,4 +64,8 @@ AdTypeSchema.statics.executeQueryTable = function(idapp, params) {
|
||||
|
||||
const AdType = mongoose.model('AdType', AdTypeSchema);
|
||||
|
||||
AdType.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = {AdType};
|
||||
|
||||
@@ -64,4 +64,8 @@ AdTypeGoodSchema.statics.executeQueryTable = function(idapp, params) {
|
||||
|
||||
const AdTypeGood = mongoose.model('AdTypeGood', AdTypeGoodSchema);
|
||||
|
||||
AdTypeGood.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = {AdTypeGood};
|
||||
|
||||
@@ -122,4 +122,8 @@ bookingSchema.statics.findAllDistinctByBooking = function (idapp) {
|
||||
|
||||
const Booking = mongoose.model('Booking', bookingSchema);
|
||||
|
||||
Booking.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Booking };
|
||||
|
||||
@@ -76,4 +76,8 @@ BotSchema.statics.findAllIdApp = async function(idapp) {
|
||||
|
||||
const MyBot = mongoose.model('Bot', BotSchema);
|
||||
|
||||
MyBot.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = {MyBot};
|
||||
|
||||
@@ -76,4 +76,8 @@ CalZoomSchema.statics.getNextZoom = async function (idapp) {
|
||||
|
||||
const CalZoom = mongoose.model('CalZoom', CalZoomSchema);
|
||||
|
||||
CalZoom.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { CalZoom };
|
||||
|
||||
@@ -31,6 +31,10 @@ const CartSchema = new Schema({
|
||||
|
||||
var Cart = module.exports = mongoose.model('Cart', CartSchema);
|
||||
|
||||
Cart.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports.findAllIdApp = async function (idapp, userId) {
|
||||
const myfind = { idapp, userId };
|
||||
|
||||
|
||||
@@ -82,6 +82,10 @@ const CashSchema = new Schema({
|
||||
|
||||
var Cash = module.exports = mongoose.model('Cash', CashSchema);
|
||||
|
||||
Cash.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports.getFieldsForSearch = function () {
|
||||
return []
|
||||
};
|
||||
|
||||
@@ -28,6 +28,10 @@ const CashCategorySchema = new Schema({
|
||||
|
||||
var CashCategory = module.exports = mongoose.model('CashCategory', CashCategorySchema);
|
||||
|
||||
CashCategory.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports.getFieldsForSearch = function () {
|
||||
return []
|
||||
};
|
||||
@@ -66,3 +70,4 @@ module.exports.createCashCategory = async function (CashCategory) {
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -69,3 +69,7 @@ module.exports.createCashSubCategory = async function (CashSubCategory) {
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -50,4 +50,9 @@ CategorySchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
const Category = mongoose.model('Category', CategorySchema);
|
||||
|
||||
Category.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
|
||||
module.exports = { Category };
|
||||
|
||||
@@ -80,4 +80,8 @@ CatGrpSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
|
||||
const CatGrp = mongoose.model('CatGrp', CatGrpSchema);
|
||||
|
||||
CatGrp.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { CatGrp };
|
||||
|
||||
@@ -43,5 +43,9 @@ CfgServerSchema.statics.findAllIdApp = async function(idapp) {
|
||||
|
||||
const CfgServer = mongoose.model('CfgServer', CfgServerSchema);
|
||||
|
||||
CfgServer.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = {CfgServer};
|
||||
|
||||
|
||||
@@ -1221,4 +1221,8 @@ CircuitSchema.statics.setFido = async function (idapp, username, circuitName, gr
|
||||
|
||||
const Circuit = mongoose.model('Circuit', CircuitSchema);
|
||||
|
||||
Circuit.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Circuit };
|
||||
|
||||
@@ -201,4 +201,8 @@ CitySchema.statics.findAllIdApp = async function(idapp) {
|
||||
|
||||
const City = mongoose.model('City', CitySchema);
|
||||
|
||||
City.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = {City};
|
||||
|
||||
@@ -52,4 +52,8 @@ ContribtypeSchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
const Contribtype = mongoose.model('Contribtype', ContribtypeSchema);
|
||||
|
||||
Contribtype.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Contribtype };
|
||||
|
||||
@@ -26,6 +26,10 @@ const departmentSchema = new Schema({
|
||||
|
||||
var Department = module.exports = mongoose.model('Department', departmentSchema);
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports.getFieldsForSearch = function () {
|
||||
return [{ field: 'name', type: tools.FieldType.string },
|
||||
{ field: 'username', type: tools.FieldType.string }
|
||||
|
||||
@@ -106,4 +106,8 @@ DisciplineSchema.statics.DuplicateAllRecords = async function (idapporig, idappd
|
||||
|
||||
const Discipline = mongoose.model('Discipline', DisciplineSchema);
|
||||
|
||||
Discipline.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Discipline };
|
||||
|
||||
@@ -332,6 +332,9 @@ ExtraListSchema.statics.ImportData = async function (locale, idapp, strdata) {
|
||||
|
||||
const ExtraList = mongoose.model('ExtraList', ExtraListSchema);
|
||||
|
||||
ExtraList.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { ExtraList };
|
||||
|
||||
|
||||
@@ -64,4 +64,8 @@ GallerySchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
const Gallery = mongoose.model('Gallery', GallerySchema);
|
||||
|
||||
Gallery.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Gallery };
|
||||
|
||||
@@ -80,4 +80,8 @@ GoodSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
|
||||
const Good = mongoose.model('Good', GoodSchema);
|
||||
|
||||
Good.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Good };
|
||||
|
||||
@@ -415,4 +415,8 @@ GraduatoriaSchema.statics.getPosizioneInGraduatoria = async function (idapp, ind
|
||||
|
||||
const Graduatoria = mongoose.model('Graduatoria', GraduatoriaSchema);
|
||||
|
||||
Graduatoria.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Graduatoria };
|
||||
|
||||
@@ -47,3 +47,6 @@ module.exports.findAllIdApp = async function (idapp) {
|
||||
return await Group.find(myfind);
|
||||
};
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -228,3 +228,6 @@ module.exports.calculateHoursTodo = async function (idtodo) {
|
||||
|
||||
};
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -196,3 +196,7 @@ module.exports.findAllIdApp = async function(idapp) {
|
||||
return arrrec;
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -196,3 +196,7 @@ module.exports.findAllIdApp = async function (idapp) {
|
||||
return arrrec
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -73,4 +73,8 @@ LevelSchema.statics.executeQueryTable = function(idapp, params) {
|
||||
|
||||
const Level = mongoose.model('Level', LevelSchema);
|
||||
|
||||
Level.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = {Level};
|
||||
|
||||
@@ -121,4 +121,8 @@ MailingListSchema.statics.findByHash = function (idapp, hash) {
|
||||
|
||||
const MailingList = mongoose.model('MailingList', MailingListSchema);
|
||||
|
||||
MailingList.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MailingList };
|
||||
|
||||
@@ -693,4 +693,8 @@ MovementSchema.statics.checkIfCoinsAlreadySent = async function (notifId) {
|
||||
|
||||
const Movement = mongoose.model('Movement', MovementSchema);
|
||||
|
||||
Movement.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Movement };
|
||||
|
||||
@@ -125,4 +125,8 @@ MsgTemplateSchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
const MsgTemplate = mongoose.model('MsgTemplate', MsgTemplateSchema);
|
||||
|
||||
MsgTemplate.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MsgTemplate };
|
||||
|
||||
@@ -378,4 +378,8 @@ MyBachecaSchema.statics.getCompleteRecord = function (idapp, id) {
|
||||
|
||||
const MyBacheca = mongoose.model('MyBacheca', MyBachecaSchema);
|
||||
|
||||
MyBacheca.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MyBacheca };
|
||||
|
||||
@@ -210,4 +210,8 @@ MyElemSchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
const MyElem = mongoose.model('MyElem', MyElemSchema);
|
||||
|
||||
MyElem.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MyElem };
|
||||
|
||||
@@ -276,4 +276,8 @@ if (tools.INITDB_FIRSTIME) {
|
||||
|
||||
const MyEvent = mongoose.model('MyEvent', MyEventSchema);
|
||||
|
||||
MyEvent.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = {MyEvent};
|
||||
|
||||
@@ -348,4 +348,8 @@ MyGoodSchema.statics.getProject = function () {
|
||||
|
||||
const MyGood = mongoose.model('MyGood', MyGoodSchema);
|
||||
|
||||
MyGood.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MyGood };
|
||||
|
||||
@@ -643,4 +643,8 @@ MyGroupSchema.statics.setReceiveRisGroup = async function (idapp, groupname) {
|
||||
|
||||
const MyGroup = mongoose.model('MyGroup', MyGroupSchema);
|
||||
|
||||
MyGroup.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MyGroup };
|
||||
|
||||
@@ -348,4 +348,8 @@ MyHospSchema.statics.getProject = function () {
|
||||
|
||||
const MyHosp = mongoose.model('MyHosp', MyHospSchema);
|
||||
|
||||
MyHosp.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MyHosp };
|
||||
|
||||
@@ -218,4 +218,8 @@ MyPageSchema.statics.findInternalPages = async function (idapp) {
|
||||
|
||||
const MyPage = mongoose.model('MyPage', MyPageSchema);
|
||||
|
||||
MyPage.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MyPage };
|
||||
|
||||
@@ -354,4 +354,8 @@ MySkillSchema.statics.getCompleteRecord = function (idapp, id) {
|
||||
|
||||
const MySkill = mongoose.model('MySkill', MySkillSchema);
|
||||
|
||||
MySkill.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { MySkill };
|
||||
|
||||
@@ -170,4 +170,8 @@ NewstosentSchema.statics.isActivated = async function (_id) {
|
||||
|
||||
const Newstosent = mongoose.model('Newstosent', NewstosentSchema);
|
||||
|
||||
Newstosent.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Newstosent };
|
||||
|
||||
@@ -118,4 +118,8 @@ OperatorSchema.statics.findAllIdApp = function (idapp) {
|
||||
|
||||
const Operator = mongoose.model('Operator', OperatorSchema);
|
||||
|
||||
Operator.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Operator };
|
||||
|
||||
@@ -43,4 +43,8 @@ OpzEmailSchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
const OpzEmail = mongoose.model('OpzEmail', OpzEmailSchema);
|
||||
|
||||
OpzEmail.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { OpzEmail };
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
const mongoose = require('mongoose').set('debug', false)
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
const { ObjectID } = require('mongodb');
|
||||
|
||||
@@ -79,11 +79,17 @@ const orderSchema = new Schema({
|
||||
|
||||
var Order = module.exports = mongoose.model('Order', orderSchema);
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports.getFieldsForSearch = function () {
|
||||
return []
|
||||
};
|
||||
|
||||
module.exports.executeQueryTable = function (idapp, params) {
|
||||
const tools = require('../tools/general');
|
||||
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
|
||||
@@ -276,3 +276,7 @@ OrdersCartSchema.pre('save', async function (next) {
|
||||
console.error(e.message);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -45,4 +45,8 @@ PaymentTypeSchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
const PaymentType = mongoose.model('Paymenttype', PaymentTypeSchema);
|
||||
|
||||
PaymentType.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { PaymentType };
|
||||
|
||||
@@ -57,4 +57,8 @@ PermissionSchema.statics.findAllIdApp = async function () {
|
||||
|
||||
const Permission = mongoose.model('Permission', PermissionSchema);
|
||||
|
||||
Permission.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Permission };
|
||||
|
||||
@@ -100,3 +100,7 @@ module.exports.getProducerByID = function (id, callback) {
|
||||
// const Producer = mongoose.model('Producer', producerSchema);
|
||||
|
||||
// module.exports = { Producer };
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -122,6 +122,8 @@ const productSchema = new Schema({
|
||||
|
||||
var Product = module.exports = mongoose.model('Product', productSchema);
|
||||
|
||||
productSchema.index({ idapp: 1 });
|
||||
|
||||
module.exports.getFieldsForSearch = function () {
|
||||
return [{ field: 'name', type: tools.FieldType.string }]
|
||||
};
|
||||
@@ -211,6 +213,9 @@ module.exports.getProductByID = function (id, callback) {
|
||||
Product.findById(id, callback);
|
||||
}
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
|
||||
// const Product = mongoose.model('Product', ProductSchema);
|
||||
|
||||
@@ -428,5 +428,9 @@ ProjectSchema.pre('save', function (next) {
|
||||
|
||||
var Project = mongoose.model('Projects', ProjectSchema);
|
||||
|
||||
Project.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Project };
|
||||
|
||||
|
||||
@@ -127,4 +127,8 @@ ProvinceSchema.statics.findAllIdApp = async function(idapp) {
|
||||
|
||||
const Province = mongoose.model('Province', ProvinceSchema);
|
||||
|
||||
Province.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = {Province};
|
||||
|
||||
@@ -433,4 +433,8 @@ reactionSchema.statics.removeBookmark = async function (
|
||||
|
||||
const Reaction = mongoose.model('Reaction', reactionSchema);
|
||||
|
||||
Reaction.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Reaction };
|
||||
|
||||
@@ -42,4 +42,8 @@ searchSchema.statics.findAllByUserIdAndIdApp = function (userId, idapp, sall) {
|
||||
|
||||
const Search = mongoose.model('Search', searchSchema);
|
||||
|
||||
Search.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Search };
|
||||
|
||||
@@ -80,4 +80,8 @@ SectorGoodSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
|
||||
const SectorGood = mongoose.model('SectorGood', SectorGoodSchema);
|
||||
|
||||
SectorGood.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { SectorGood };
|
||||
|
||||
@@ -109,4 +109,8 @@ sendmsgSchema.statics.findLastGroupByUserIdAndIdApp = function (userId, username
|
||||
|
||||
const SendMsg = mongoose.model('SendMsg', sendmsgSchema);
|
||||
|
||||
SendMsg.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { SendMsg };
|
||||
|
||||
@@ -1220,4 +1220,8 @@ sendNotifSchema.statics.checkIfAlreadyExist = async function (idapp, tag, idpost
|
||||
|
||||
const SendNotif = mongoose.model('SendNotif', sendNotifSchema);
|
||||
|
||||
SendNotif.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { SendNotif: SendNotif };
|
||||
|
||||
@@ -178,4 +178,8 @@ SettingsSchema.statics.getKeyNum = async function (idapp, key, mydefault) {
|
||||
|
||||
const Settings = mongoose.model('Settings', SettingsSchema);
|
||||
|
||||
Settings.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Settings };
|
||||
|
||||
@@ -47,3 +47,6 @@ module.exports.findAllIdApp = async function (idapp) {
|
||||
return await ShareWithUs.find(myfind);
|
||||
};
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
const mongoose = require('mongoose').set('debug', false)
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
@@ -217,7 +215,6 @@ module.exports.executeQueryTable = async function (idapp, params, userreq) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
module.exports.findAll = async function () {
|
||||
@@ -357,3 +354,7 @@ module.exports.createFirstUserAdmin = async function () {
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -78,4 +78,8 @@ SkillSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
|
||||
const Skill = mongoose.model('Skill', SkillSchema);
|
||||
|
||||
Skill.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Skill };
|
||||
|
||||
@@ -75,4 +75,8 @@ StatusSkillSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
|
||||
const StatusSkill = mongoose.model('StatusSkill', StatusSkillSchema);
|
||||
|
||||
StatusSkill.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { StatusSkill };
|
||||
|
||||
@@ -59,3 +59,6 @@ module.exports.findAllIdApp = async function (idapp) {
|
||||
return await Storehouse.find(myfind);
|
||||
};
|
||||
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -24,4 +24,8 @@ const SubscriberSchema = new Schema({
|
||||
}
|
||||
});
|
||||
|
||||
mongoose.model('subscribers', SubscriberSchema);
|
||||
var Subscription = module.exports = mongoose.model('subscribers', SubscriberSchema);
|
||||
|
||||
Subscription.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -78,4 +78,8 @@ SubSkillSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
|
||||
const SubSkill = mongoose.model('SubSkill', SubSkillSchema);
|
||||
|
||||
SubSkill.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { SubSkill };
|
||||
|
||||
@@ -67,4 +67,8 @@ TemplEmailSchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
const TemplEmail = mongoose.model('TemplEmail', TemplEmailSchema);
|
||||
|
||||
TemplEmail.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { TemplEmail };
|
||||
|
||||
@@ -519,5 +519,9 @@ TodoSchema.pre('save', function (next) {
|
||||
|
||||
var Todo = mongoose.model('Todos', TodoSchema);
|
||||
|
||||
Todo.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Todo };
|
||||
|
||||
|
||||
@@ -4721,7 +4721,7 @@ if (tools.INITDB_FIRSTIME) {
|
||||
console.log(' createIndex User Index...');
|
||||
|
||||
UserSchema.index({ userId: 1 });
|
||||
UserSchema.index({ 'idapp': 1 });
|
||||
UserSchema.index({ idapp: 1 });
|
||||
|
||||
|
||||
// UserSchema.index({ username: 'text', name: 'text', surname: 'text', email: 'text' });
|
||||
@@ -5434,6 +5434,10 @@ UserSchema.statics.createNewSubRecord = async function (idapp, req) {
|
||||
|
||||
const User = mongoose.model('User', UserSchema);
|
||||
|
||||
User.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
class Hero {
|
||||
constructor(name, level) {
|
||||
this.name = name;
|
||||
|
||||
@@ -95,4 +95,8 @@ UserRequestSchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
const UserRequest = mongoose.model('UserRequest', UserRequestSchema);
|
||||
|
||||
UserRequest.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { UserRequest };
|
||||
|
||||
@@ -38,3 +38,7 @@ module.exports.getVariantProductByID = function(id, callback){
|
||||
module.exports.getAllVariants = function(callback){
|
||||
Variant.find(callback)
|
||||
}
|
||||
module.exports.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
@@ -51,4 +51,8 @@ WhereSchema.statics.findAllIdApp = async function (idapp) {
|
||||
|
||||
const Where = mongoose.model('Where', WhereSchema);
|
||||
|
||||
Where.createIndexes((err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
|
||||
module.exports = { Where };
|
||||
|
||||
@@ -96,7 +96,7 @@ class Cart {
|
||||
this.totalQty += order.quantity;
|
||||
this.totalPrice += order.price * order.quantity;
|
||||
}
|
||||
|
||||
|
||||
this.totalPrice = parseFloat(this.totalPrice.toFixed(2))
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const mongoose = require('mongoose').set('debug', false)
|
||||
const Subscription = mongoose.model('subscribers');
|
||||
const Subscription = require('../../models/subscribers');
|
||||
|
||||
//const { ListaIngresso } = require('../../models/listaingresso');
|
||||
const { Graduatoria } = require('../../models/graduatoria');
|
||||
|
||||
@@ -99,6 +99,7 @@ router.post('/:userId', authenticate, async function (req, res, next) {
|
||||
|
||||
|
||||
} catch (e) {
|
||||
console.error('Err:', e);
|
||||
return res.send({ code: server_constants.RIS_CODE_ERR, cart: 0 });
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ var server_constants = require('../tools/server_constants');
|
||||
var { authenticate, authenticate_noerror, auth_default } = require('../middleware/authenticate');
|
||||
|
||||
var mongoose = require('mongoose').set('debug', false);
|
||||
const Subscription = mongoose.model('subscribers');
|
||||
const Subscription = require('../models/subscribers');
|
||||
|
||||
const _ = require('lodash');
|
||||
const { MyBacheca } = require('../models/mybacheca');
|
||||
|
||||
@@ -10,7 +10,7 @@ var server_constants = require('../tools/server_constants');
|
||||
var {authenticate, auth_default} = require('../middleware/authenticate');
|
||||
|
||||
var mongoose = require('mongoose').set('debug', false);
|
||||
const Subscription = mongoose.model('subscribers');
|
||||
const Subscription = require('../models/subscribers');
|
||||
|
||||
const _ = require('lodash');
|
||||
const {MyGood} = require('../models/mygood');
|
||||
|
||||
@@ -10,7 +10,7 @@ var server_constants = require('../tools/server_constants');
|
||||
var {authenticate, auth_default} = require('../middleware/authenticate');
|
||||
|
||||
var mongoose = require('mongoose').set('debug', false);
|
||||
const Subscription = mongoose.model('subscribers');
|
||||
const Subscription = require('../models/subscribers');
|
||||
|
||||
const _ = require('lodash');
|
||||
const {MySkill} = require('../models/myskill');
|
||||
|
||||
@@ -12,7 +12,7 @@ var { Project } = require('../models/project');
|
||||
var { authenticate, auth_default } = require('../middleware/authenticate');
|
||||
|
||||
var mongoose = require('mongoose').set('debug', false)
|
||||
const Subscription = mongoose.model('subscribers');
|
||||
const Subscription = require('../models/subscribers');
|
||||
|
||||
const _ = require('lodash');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const mongoose = require('mongoose').set('debug', false);
|
||||
const Subscription = mongoose.model('subscribers');
|
||||
const Subscription = require('../models/subscribers');
|
||||
// const q = require('q');
|
||||
const webpush = require('web-push');
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const mongoose = require('mongoose').set('debug', false);
|
||||
const Subscription = mongoose.model('subscribers');
|
||||
const Subscription = require('../models/subscribers');
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ var { Project } = require('../models/project');
|
||||
var { authenticate } = require('../middleware/authenticate');
|
||||
|
||||
var mongoose = require('mongoose').set('debug', false)
|
||||
const Subscription = mongoose.model('subscribers');
|
||||
const Subscription = require('../models/subscribers');
|
||||
|
||||
var { Todo } = require('../models/todo');
|
||||
const { Settings } = require('../models/settings');
|
||||
|
||||
@@ -43,7 +43,7 @@ const { Account } = require('../models/account');
|
||||
|
||||
const mongoose = require('mongoose').set('debug', false);
|
||||
|
||||
const Subscription = mongoose.model('subscribers');
|
||||
const Subscription = require('../models/subscribers');
|
||||
|
||||
function existSubScribe(userId, access, browser) {
|
||||
return Subscription.findOne({ userId, access, browser }).then(itemsub => {
|
||||
|
||||
@@ -63,6 +63,7 @@ console.log('DB: ' + process.env.DATABASE);
|
||||
|
||||
var app = express();
|
||||
|
||||
|
||||
let telegrambot = null;
|
||||
|
||||
const tools = require('./tools/general');
|
||||
|
||||
@@ -10,8 +10,6 @@ require('../models/subscribers');
|
||||
|
||||
const printf = require('util').format;
|
||||
|
||||
const Site = require('../models/site');
|
||||
|
||||
const CryptoJS = require('crypto-js');
|
||||
|
||||
const Url = require('url-parse');
|
||||
@@ -21,7 +19,7 @@ const { ObjectID, ObjectId } = require('mongodb');
|
||||
const shared_consts = require('./shared_nodejs');
|
||||
|
||||
const mongoose = require('mongoose').set('debug', false);
|
||||
const Subscription = mongoose.model('subscribers');
|
||||
const Subscription = require('../models/subscribers');
|
||||
|
||||
const server_constants = require('./server_constants');
|
||||
|
||||
@@ -2952,14 +2950,14 @@ module.exports = {
|
||||
|
||||
startTimeLog(name) {
|
||||
if (this.testing()) {
|
||||
console.log('inizio', name);
|
||||
// console.log('inizio', name);
|
||||
console.time(name);
|
||||
}
|
||||
},
|
||||
|
||||
endTimeLog(name) {
|
||||
if (this.testing()) {
|
||||
console.log(' ... fine', name);
|
||||
// console.log(' ... fine', name);
|
||||
console.timeEnd(name);
|
||||
}
|
||||
},
|
||||
@@ -3920,6 +3918,8 @@ module.exports = {
|
||||
},
|
||||
|
||||
async loadApps() {
|
||||
const Site = require('../models/site');
|
||||
|
||||
try {
|
||||
this.MYAPPS = await Site.findAll(0);
|
||||
// console.log('this.MYAPPS', this.MYAPPS);
|
||||
@@ -3927,6 +3927,7 @@ module.exports = {
|
||||
console.error('loadApps', e);
|
||||
}
|
||||
},
|
||||
|
||||
async getApps() {
|
||||
if (this.MYAPPS.length <= 0)
|
||||
await this.loadApps();
|
||||
|
||||
Reference in New Issue
Block a user