I want to update a set of array of object using date range. I did below query
Person.update({'data.date': {'$gte': '1-1-2016', '$lte': '1-5-2016'}},
{'$set': {'data.$.score':1000}},
{multi:true})
Turned out the score
on date 1-1-2016
only been updated, something is wrong with the $lte?
This is my schema
var Person = new Schema({
name: String,
data: [{
date: Date,
score: Number
}]
});