Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
jobs: {
_id: {type: ObjectId, ref: 'jobs', default: null},
name: {type: String, default: ''}
}}, {collection: 'wTrack'});
function setPrice(num) {
return num * 100;
}
mongoose.model('wTrackOld', wTrackSchema);
if (!mongoose.Schemas) {
mongoose.Schemas = {};
}
mongoose.Schemas['wTrackOld'] = wTrackSchema;
var wTrackSchema = mongoose.Schemas['wTrack'];
var wTrackSchemaOld = mongoose.Schemas['wTrackOld'];
var dbObject = mongoose.createConnection('localhost', 'production');
dbObject.on('error', console.error.bind(console, 'connection error:'));
dbObject.once('open', function callback() {
console.log("Connection to production is success");
});
var wTrackOld = dbObject.model("wTrackNew", wTrackSchemaOld);
var wTrack = dbObject.model("wTrack", wTrackSchema);
var query = wTrackOld.find().lean();
bonus : Array,
projectTeam: [{type: ObjectId, ref: "jobs", default: null}]
}
}, {collection: 'Project'});
projectSchema.set('toJSON', {virtuals: true});
mongoose.model('ProjectOld', projectSchema);
if (!mongoose.Schemas) {
mongoose.Schemas = {};
}
mongoose.Schemas['ProjectOld'] = projectSchema;
var ProjectSchema = mongoose.Schemas['Project'];
var ProjectSchemaOld = mongoose.Schemas['ProjectOld'];
//var dbObject = mongoose.createConnection('localhost', 'production');
var connectOptions = {
user : 'easyerp',
pass : '1q2w3e!@#',
w : 1,
j : true
};
var dbObject = mongoose.createConnection('144.76.56.111', 'sergey', 28017, connectOptions);
dbObject.on('error', console.error.bind(console, 'connection error:'));
dbObject.once('open', function callback() {
console.log("Connection to production is success");
});
/**
* Created by liliya on 29.09.15.
*/
var mongoose = require('mongoose');
require('../models/index.js');
var ProjectSchema = mongoose.Schemas['Project'];
var wTrackSchema = mongoose.Schemas['wTrack'];
var MonthHoursSchema = mongoose.Schemas['MonthHours'];
var EmployeeSchema = mongoose.Schemas['Employee'];
var _ = require('../node_modules/underscore');
var async = require('async');
var JobsSchema = mongoose.Schemas['jobs'];
var dbObject = mongoose.createConnection('localhost', 'production');
dbObject.on('error', console.error.bind(console, 'connection error:'));
dbObject.once('open', function callback() {
console.log("Connection to weTrack is success");
var Project = dbObject.model('Project', ProjectSchema);
var Employee = dbObject.model('Employees', EmployeeSchema);
var Job = dbObject.model("jobs", JobsSchema);
var paralellTasks;
var count = 0;
var mongoose = require('mongoose');
var savedFiltersSchema = mongoose.Schema({
ID : Number,
name : String,
filter: JSON
}, {collection: 'savedFilters'});
mongoose.model('savedFilters', savedFiltersSchema);
if (!mongoose.Schemas) {
mongoose.Schemas = {};
}
mongoose.Schemas.savedFilters = savedFiltersSchema;
})();
/**
* Created by liliya on 22.10.15.
*/
var mongoose = require('mongoose');
var ObjectId = mongoose.Schema.Types.ObjectId;
require('../models/index.js');
var async = require('async');
var QuotationSchema = mongoose.Schemas['Quotation'];
var InvoiceSchema = mongoose.Schemas['Invoice'];
var JobsSchema = mongoose.Schemas['jobs'];
var ProjectSchema = mongoose.Schemas['Project'];
var objectId = mongoose.Types.ObjectId;
var CONSTANTS = require('../constants/mainConstants');
var productService = CONSTANTS.PRODUCRSERVICE;
var wTrackSchema = mongoose.Schema({
ID: Number,
dateByWeek: Number,
dateByMonth: Number,
project: {
_id: {
type: ObjectId, ref: 'Project', default: null
},
var mongoose = require('mongoose');
require('../../models/index.js');
var async = require('async');
var ModuleSchema = mongoose.Schemas.modules;
var connectOptions = {
user: 'easyerp',
pass: '1q2w3e!@#',
w : 1,
j : true
};
var dbObject = mongoose.createConnection('144.76.56.111', 'alex', 28017, connectOptions);
//var dbObject = mongoose.createConnection('localhost', 'production');
var Module = dbObject.model("modules", ModuleSchema);
var parallelTasks = [function (cb) {
Module.update({_id: 54}, {visible : false}, cb);
ancestors: [Number],
users : {},
parrent : Number,
sequence : Number,
link : Boolean,
visible : Boolean,
single : {type: Boolean, default: false}
}, {collection: 'modules'});
mongoose.model('modules', moduleSchema);
if (!mongoose.Schemas) {
mongoose.Schemas = {};
}
mongoose.Schemas.module = moduleSchema;
})();
'use strict';
var mongoose = require('mongoose');
var CategorySchema = mongoose.Schemas.ProductCategory;
var populateWrapper = require('../helpers/callbackWrapper').populate;
var validator = require('validator');
var _ = require('lodash');
module.exports = function (models) {
return new function () {
this.create = function (options, callback) {
var dbName;
var CategoryModel;
var category;
var err;
if (typeof options === 'function') {
callback = options;
options = {};
}
}],
budget: {
_id : false,
bonus : Array,
projectTeam: [{type: ObjectId, ref: 'jobs', default: null}]
}
}, {collection: 'Project'});
mongoose.model('Project', projectSchema);
if (!mongoose.Schemas) {
mongoose.Schemas = {};
}
mongoose.Schemas.Project = projectSchema;
})();
this.getSalesQuotationFilters = function (req, res, next) {
var lastDB = req.session.lastDb;
var QuotationSchema = mongoose.Schemas.Quotation;
var Quotation = models.get(lastDB, 'Quotation', QuotationSchema);
var pipeLine;
var aggregation;
var query = {
forSales: true,
isOrder : false
};
pipeLine = [{
$match: query
}, {
$lookup: {
from : 'projectMembers',
localField : 'project',
foreignField: 'projectId',
as : 'projectMembers'