36 works

Append a Value to an Array

dashboard+ Project

Posted by @starbucks #javascript #nodejs

   { _id: 1 },
   { $push: { scores: 89 } }
content_copyCopy to Clipboard

The processing of the push operation with modifiers occur in the following order, regardless of the order in which the modifiers appear: Update array to add elements in the correct position. Apply sort, if specified. Slice the array, if specified. Store the array.


>> Browse more code snippets