Array.push does not seem to work on MongoDB
问题 I would like to create a dynamic vector/array in MongoDB. The idea is simple: whenever someone submits something, it should update a user in my database in MongoDB. I have created a variable for that. I have already tested: the proper user is found correctly. Please, find it a snippet of my code. User.findOne({ name }) .then(user => { user.something.push(something to push); }) I have set the default value when it is created as empty: something: { type: [String], default: [] } However, it does