Using mongoose to update an array

I have an array field in mongoose which I need to update. Right now I am using the foloowing:

 var fieldsToSet = {
      somename: req.body.username,
      email: req.body.email.toLowerCase(),
      $addToSet:{array_field:'some single value'},
      search: [
        req.body.username,
        req.body.email,

      ],
    };

I update it using

 req.app.db.models.User.findByIdAndUpdate(req.user.id, fieldsToSet, options, function(err, user) {
      if (err) {
        return workflow.emit('exception', err);
      }

      workflow.emit('patchAdmin', user);
    });

However it does not seem to work. COuld someone please help me out?

var userSchema = new mongoose.Schema({
    username: { type: String, unique: true },
    password: String,
     array_field:[String],
    email: { type: String, unique: true },

You cannot mix what are essentially two types of "update" options. MongoDB will either "replace" the whole document with the arguments provided or apply the "operators" you specify.

It appears that you want $set here as well:

var fieldsToSet = {
      "$set": {
          "somename": req.body.username,
          "email": req.body.email.toLowerCase(),
          "search": [
            req.body.username,
            req.body.email,
          ]
      },
      "$addToSet":{ "array_field": 'some single value' },
};