This is my code snippet:
import mongoose from 'mongoose';
const UserData = new mongoose.Schema({
additionalData: Array,
name: String,
});
mongoose.model('UserData', UserDataSchema);
mongoose.set('useFindAndModify', false);
export default mongoose.model('UserData');
I'm looking for a way to update the additionalData
property of the UserData
model so that another array can be appended.
For example, let's say the additional array is
[ 1, 2, 3]