Created
February 2, 2017 12:26
-
-
Save aitchkhan/4909a361c5abec16c8e875f522ded357 to your computer and use it in GitHub Desktop.
pushes multiple embedded doc to an array
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
//pushes multiple embedded doc to array | |
db.latestItems.update({}, { | |
$push: { | |
items: { | |
$each: [ {item_name: 'third item', price: 20 }, {item_name: 'forth item', price: 50 }] | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment