Created
February 24, 2015 21:29
-
-
Save zohar/b873e6abd10b0d88937f to your computer and use it in GitHub Desktop.
use regex to update multiple lines in mongo
This file contains 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
/* | |
use regex to update multiple lines in mongo | |
*/ | |
db.users.update({"email":{$regex:'.*@example.com$'}},{ $set: {"roles" : [ "authenticated", "admin" ] }}, {multi: true, upsert:false}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment