Excluding fields not working on Model.find
Topic_Model.find(cmd,'-is_draft',{sort:'-create_at'},callback)
i pass the param '-is_draft' but when run the application ,the query is wating,it does't return any thing.
and final the application catch the error FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory.
but when i pass another field this model '-tags' it worked,why?
@onlyoneice can you provide the full code?
@enrichz
var TopicSchema = new Schema({
title:{type:String},
content:{type:String},
cover_image:{type:String,default:null},
author_id:{type:String},
author_nick_id:{type:String},
close:{type:Boolean,default:false},
reply_count:{type:Number,default:0},
visit_count:{type:Number,default:0},
collect_count:{type:Number,default:0},
tab:{type:String},
ups:[String],
tags:[String],
last_reply:{type:String,default:''},
last_reply_at:{type:Date,default:Date.now},
is_draft:{type:Boolean,default:false},
delete:{type:Boolean,default:false},
create_at:{type:Date,default:Date.now},
update_at:{type:Date,default:Date.now}
});
and the query is
Topic_Model.find({delete:false,tab:tab},null,{sort:'-create_at',skip:skipsize,limit:pagesize},callback);
but when i
Topic_Model.find({delete:false,tab:tab},'-tags',{sort:'-create_at',skip:skipsize,limit:pagesize},callback);
is ok,so i don't understand why?
@enrichz i found the reason ,it cause by another package,not mongoose,thanks