为什么调用mongoose时会收到空数组?

为什么调用mongoose时会收到空数组?,mongoose,mongoose-schema,Mongoose,Mongoose Schema,我正试图从该集合中获取数据,但始终返回一个空数组。这是我的模型: const mongoose=require('mongoose'); const TimerSchema=mongoose.Schema({ 标题:{ 类型:字符串, 要求:正确, }, 时间:{ 类型:数字, 要求:正确, 默认值:0, }, 日期:{ 类型:日期, 默认值:Date.now, }, }); const TimerModel=mongoose.model('timer',TimerSchema); modul

我正试图从该集合中获取数据,但始终返回一个空数组。这是我的模型:

const mongoose=require('mongoose');
const TimerSchema=mongoose.Schema({
标题:{
类型:字符串,
要求:正确,
},
时间:{
类型:数字,
要求:正确,
默认值:0,
},
日期:{
类型:日期,
默认值:Date.now,
},
});
const TimerModel=mongoose.model('timer',TimerSchema);

module.exports=TimerModel是否使用所述模型将数据添加到MongoDB?集合是否命名为计时器?您是否能够使用Mongoose访问数据库中的其他数据?