猫鼬find()没有返回期望的结果

时间:2020-10-25 19:08:13

标签: mongoose

试图从猫鼬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个文档。

0 个答案:

没有答案