1const FinanceTypeModel = require('./../lib/finance-type-model');
2// index.js
3// ----------------------------------------------------------
4const nanit = require('nanit');
5// Initialization Middleware (via Nanit)
6nanit.initialize((err) => {
7 if (err) { throw err; }
8 // start your app
9 clearAllDescriptions();
10});
11
12
13// ./initializers/mongo.js
14// ----------------------------------------------------------
15const mongoose = require('mongoose');
16const epa = require('epa').getEnvironment();
17
18function clearAllDescriptions() {
19 debugger;
20 FinanceTypeModel.update({}, { descriptions: [] }, { multi: true }, (err, res) => {
21 if(err) {
22 throw err;
23 }
24 console.log('Finished Migration Script', res);
25 });
26}
27Created on 9/28/2018