Created
February 26, 2015 09:20
-
-
Save zohar/426b60e1d73709bc3c94 to your computer and use it in GitHub Desktop.
Find and replace an element in an array in a sub document
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
// after.2.value - becaus ewe know exactly what to look for | |
db.test.update({after:{$elemMatch:{"type":"password"}}},{$set:{"after.2.value":'xxxxx'}},{multi:true, upsert:false}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment