Skip to content

Instantly share code, notes, and snippets.

@johndobrien
Created June 13, 2017 13:12
Show Gist options
  • Save johndobrien/6640bba4ed1b6fd657eb2634e90bce87 to your computer and use it in GitHub Desktop.
Save johndobrien/6640bba4ed1b6fd657eb2634e90bce87 to your computer and use it in GitHub Desktop.
/***********************************************
* Removes outdated properties from RL mongodb
*
* Run the following on the command line:
* mongo localhost:27017/recovery_library_development cleanup_rl.js
************************************************/
db.content.update({}, {$unset: {latest: ""}},{multi: true});
db.content.update({}, {$unset: {'liker_ids': ""}},{multi: true});
db.content.update({}, {$unset: {'disliker_ids': ""}},{multi: true});
db.content.update({}, {$unset: {'live.cg_data': ""}},{multi: true});
db.content.update({}, {$unset: {'live.author_in_title': ""}},{multi: true});
db.content.update({}, {$unset: {'live.publisher_in_title': ""}},{multi: true});
db.content.update({}, {$unset: {'live.title_audio_id': ""}},{multi: true});
db.content.update({}, {$unset: {'live.product_commonground': ""}},{multi: true});
db.content.update({}, {$unset: {'live.product_offline_recovery_library': ""}},{multi: true});
db.content.update({}, {$unset: {'live.product_recovery_library': ""}},{multi: true});
db.content.update({}, {$unset: {'live.editor_url': ""}},{multi: true});
db.content.update({}, {$unset: {'live.related_content_ids': ""}},{multi: true});
db.content.update({}, {$unset: {'live.suggestion_phrase': ""}},{multi: true});
db.content.update({}, {$unset: {'live.suggestion_phrase_audio_id': ""}},{multi: true});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment