All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scripts.1.25.0.2-users-archived-upgrade.js Maven / Gradle / Ivy

There is a newer version: 4.5.2
Show newest version

print('Archived users migration');
db.users.find({"status" : "ARCHIVED", "sourceId": {$regex : /^(?!deleted-).*/}}).forEach(
  function (user) {
    print("    update user: ", user._id, "    {source: ", user.source, ",sourceId: ", user.sourceId,"}");
    db.users.updateOne(
      { _id: user._id },
      { $set: { sourceId: 'deleted-' + user.sourceId }}
    );
  }
);




© 2015 - 2024 Weber Informatics LLC | Privacy Policy