Skip to content

Instantly share code, notes, and snippets.

@jeffyuhaoliu
Created October 17, 2013 23:48
Show Gist options
  • Save jeffyuhaoliu/7034311 to your computer and use it in GitHub Desktop.
Save jeffyuhaoliu/7034311 to your computer and use it in GitHub Desktop.
MongoDB & Node.js Final 3 - In this problem you will update a document in the Enron dataset to illustrate your mastery of updating documents from the shell. Please add the email address "mrpotatohead@mongodb.com" to the list of addresses in the "headers.To" array for the document with "headers.Message-ID" of "<8147308.1075851042335.JavaMail.evan…
use enron
db.messages.update(
{'headers.Message-ID': '<8147308.1075851042335.JavaMail.evans@thyme>'},
{$addToSet: {
"headers.To": "mrpotatohead@mongodb.com"
}},
{multi: true}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment