Skip to content

Instantly share code, notes, and snippets.

@jcnevado
Last active November 23, 2023 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcnevado/c30ff6ebce5b692d1a68a6d788bf393a to your computer and use it in GitHub Desktop.
Save jcnevado/c30ff6ebce5b692d1a68a6d788bf393a to your computer and use it in GitHub Desktop.
db.getCollection("an_compactov2").find({'source': 'youtube', 'media.id': null}).forEach(function (doc) {
if ( doc.portada_e && doc.portada_e.fid ) {
//print(doc.nid);
db.an_compactov2.updateOne({
_id: doc._id
}, {
$set: {
"media.id": doc.portada_e.fid
}
});
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment