Why can't I find documents from my MongoDB via mongoose if the attribute is a Boolean?
My Model:
var PerformerSchema = new Schema({
_id: Number,
firstname: String,
lastname: String,
active: Boolean
});
My Controller / Search Query:
Performer.find({
'active': true
}, function(err, performers) {
if (err) {
return handleError(res, err);
}
if (!performers) {
return res.send(404);
}
return res.json(performers);
});
This way the returned 'performers' array is empty. But if I change the type of the 'active' attribute in the model from Boolean to String the same Search Query finds the correct documents from my Mongo collection.