I've done two collections before "article" and "news" and it all works... If i want to do other collection mongo cant find it
var mongoose = require('mongoose');
var calendarSchema = mongoose.Schema({
name:{
type: String,
required: true
},
create_date:{
type: Date,
default: Date.now
}
});
var Calendar = module.exports = mongoose.model('calendar',calendarSchema);
module.exports.getCalendar = function(callback, limit){
Calendar.find(callback).limit(limit);
}
});
Calendar.find() returns empty array. if i change mongoose.model to " news" it works