LearnBoost/mongoose — Issue #755: Mixed Type : set value fails
Author: gitfy
Created: 2012-02-29 17:51:48+00:00
State: open

When you have a mixed type property, you should be able to set any object in it, but the following fails.

var schema = new Schema({
filter : Schema.Types.Mixed
});

var model = mongoose.model('mixedModel', schema);

var inst = new model({
filter : {
$gt : 'something'
}
});

inst.save(function(err) {

});

You will get an exception : "key $gt must not start with '$' ".