Last active
June 13, 2017 12:28
-
-
Save mrvictorn/fb089ec6e18007157daf82787118a93d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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