Mongoose Cast to ObjectId failed for value
<p>I have following schema in mongoose </p>

<pre><code>var mongoose = require("mongoose");

var Schema = mongoose.Schema;
var UserSchema = new mongoose.Schema({
  email: { type: String, unique: true },

});
var User = mongoose.model('User', UserSchema);
var ReviewSchema = new Schema({
  schoolId: String,
  firstname: String,
  image_url: String,
  lastname: { type: String },
  email: String,
  rating: Number,
  review: String,
  time: { type: Date, default: Date.now },
  updated_at: Date,
  voters: [{ type: mongoose.Schema.Types.ObjectId, ref: 'User' }]

});


var Review = mongoose.model('Review', ReviewSchema);


module.exports = Review;
</code></pre>

<p>and following code in nodejs</p>

<pre><code>app.post("/like", function (req, res) {
    var query = { id: mongoose.Types.ObjectId(req.body.id) };
    var voter = { email: req.body.email };
    var update = { $push: { 'voters': voter } };
    var options = { upsert: true, 'new': true };

    Review.findOneAndUpdate(query, update, options, function (err, doc) {
        console.log(err);
        res.end("done");
    });
});
</code></pre>

<p>When I am sending request to above method I am getting following error message</p>

<pre><code> { [CastError: Cast to ObjectId failed for value "[object Object]" at path "voters"]
     message: 'Cast to ObjectId failed for value "[object Object]" at path "voters"',
</code></pre>