Skip to content

Instantly share code, notes, and snippets.

@mrvictorn
Last active June 13, 2017 12:28
Show Gist options
  • Save mrvictorn/fb089ec6e18007157daf82787118a93d to your computer and use it in GitHub Desktop.
Save mrvictorn/fb089ec6e18007157daf82787118a93d to your computer and use it in GitHub Desktop.
'use strict';
var _Campaign = require('../models/Campaign');
const reEXCLUSIEF = new RegExp('^ww[w0-9^]\.'); //
// targets.retainTraffic.domain
const dirtyObjCursor = _Campaign.default.find({ 'targets.retainTraffic.domain': { $regex: reEXCLUSIEF } }).cursor();
dirtyObjCursor.on('data', obj => {
var src = obj.targets.retainTraffic.domain;
console.log(src);
//REMOVE //
//var res = src.replace(reEXCLUSIEF, '').trim()
//console.log('cleaning to', res);
//obj.save();
//_Campaign.default.update({_id: obj.id}, {$set: {'targets.retainTraffic.domain':res}})
// .then(ee=>console.log(ee));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment