Guest User

JS + MongoDB Append to Array

a guest
Dec 17th, 2023
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 0.15 KB | Source Code | 0 0
  1. db.collection.updateOne({_id: 'example'}, {
  2.     $push: {
  3.         'myArrayField': {
  4.             name: 'Bob',
  5.             age: 28
  6.         }
  7.     }
  8. })
  9.  
Advertisement
Add Comment
Please, Sign In to add comment