19 works

Append a Value to an Array

dashboard+ Project

Posted by @starbucks #javascript #nodejs

Code snippet:

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

More details:

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.

Code snippet source:


>> Browse more code snippets