Skip to content

Instantly share code, notes, and snippets.

@fforbeck
Created January 29, 2013 18:20
Show Gist options
  • Save fforbeck/4666347 to your computer and use it in GitHub Desktop.
Save fforbeck/4666347 to your computer and use it in GitHub Desktop.
function resumeDomainsFromCampaign(campaign) {
var cursorAds = db.rtb_bid_reference.find({campaign_id: campaign}, {id: 1});
var rtbBidRefDomainColl = db.rtb_bid_reference_domain;
while (cursorAds.hasNext()) {
var adId = cursorAds.next();
if (adId != null) {
print('Resuming Ad ' + adId.id);
rtbBidRefDomainColl.update({ad_id: adId.id}, {$set: {weight: 1}}, false, true);
print('All domains were resumed for Ad ' + adId.id);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment