试图从猫鼬find()
命令中获取数组。
使用findOne()
时,我得到了预期的结果,但是该结果应该返回多个记录。
代码如下:
const docs = await Gift.find();
console.log(docs);
这是结果:
(30) [model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model, model]
Mongo集合中有30个文档。