Skip to content
This repository has been archived by the owner on Oct 11, 2018. It is now read-only.

Commit

Permalink
Merge pull request #2 from xola/XOL-3345
Browse files Browse the repository at this point in the history
XOL-3345 - Mailchimp Plugin
  • Loading branch information
rishabh9 authored Feb 17, 2017
2 parents 52c0e0b + 6cb000c commit 3d0c1d4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions db/mailchimp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Execute this script only if you're upgrading to v0.2.2 or later.
// Not required for a fresh db.

use mailchimp;

// Add type data to preference fields of the installations
var cursor = db.getCollection('installations').find({});
while (cursor.hasNext()) {
var obj1 = cursor.next();
var prefs = obj1.preferences;
if (prefs) {
prefs.forEach(function (item) {
item.values.forEach(function (vals) {
vals['type'] = 'string';
});
});
}
db.getCollection('installations').update({'_id': obj1._id}, obj1);
}

0 comments on commit 3d0c1d4

Please sign in to comment.