Last active
May 31, 2021 11:14
-
-
Save DipandaAser/ebfc39c31357e14d7fd975c81cd12a2a to your computer and use it in GitHub Desktop.
Replace substring in mongodb documents using NosqlBooster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.File.find({}).forEach(function(document) { | |
if (document.PublicLink.startsWith("http")) { | |
document.PublicLink = document.PublicLink.replace("http", "https") | |
} | |
db.File.save(document) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment